/* Zibby World: purple / pink / teal, chunky toy-like buttons. Tweak the variables to re-theme. */
:root {
  --purple: #8f5bff; --purple-d: #5a2fc9;
  --pink: #ff5fb3; --pink-d: #c92b84;
  --teal: #14d3c4; --teal-d: #0a9a95;
  --yellow: #ffd23f; --yellow-d: #e39a10;
  --green: #4ddc7a; --green-d: #1f9f4b;
  --ink: #2b1a5e;
  --b: clamp(50px, 8.2vmin, 82px);
  --slot: clamp(42px, 8.6vmin, 76px);
  --hb: calc(var(--slot) + 34px);
  --gap: clamp(6px, 1.2vmin, 12px);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c1240; touch-action: none; overscroll-behavior: none;
  font-family: "Baloo 2", "Fredoka", "Trebuchet MS", ui-rounded, system-ui, sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 4px solid #fff; border-radius: 26%; width: var(--b); height: var(--b);
  display: inline-flex; align-items: center; justify-content: center; font-size: calc(var(--b) * 0.56); line-height: 1;
  color: #fff; cursor: pointer; text-decoration: none; padding: 0;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), 0 8px 18px rgba(30, 10, 80, 0.35);
  transition: transform 0.08s, filter 0.15s; position: relative; touch-action: manipulation;
}
.btn:active, .btn.down { transform: translateY(4px) scale(0.94); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
.btn.big { width: calc(var(--b) * 1.3); height: calc(var(--b) * 1.3); font-size: calc(var(--b) * 0.74); }
.btn.on { filter: brightness(1.12) saturate(1.2); outline: 4px solid #fff7a8; }
.btn.off { filter: grayscale(0.85) brightness(0.9); }
.purple { background: linear-gradient(160deg, #b08bff, var(--purple) 55%, var(--purple-d)); }
.pink { background: linear-gradient(160deg, #ff9ad0, var(--pink) 55%, var(--pink-d)); }
.teal { background: linear-gradient(160deg, #6ff0e3, var(--teal) 55%, var(--teal-d)); }
.yellow { background: linear-gradient(160deg, #ffe98a, var(--yellow) 55%, var(--yellow-d)); }
.green { background: linear-gradient(160deg, #8cf2ac, var(--green) 55%, var(--green-d)); }
.btn.pulse { animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.45), 0 5px 0 rgba(0, 0, 0, 0.28); } }

/* ---------- HUD layout ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud .btn, #hud .parent-btn, #hotbar { pointer-events: auto; }
.cluster { position: absolute; display: flex; gap: var(--gap); }
.cluster.tl { top: calc(var(--gap) + var(--safe-t)); left: calc(var(--gap) + var(--safe-l)); align-items: flex-start; }
.cluster.tools { top: calc(var(--b) * 1.3 + var(--gap) * 3 + var(--safe-t)); left: calc(var(--gap) + var(--safe-l)); display: grid; grid-template-columns: repeat(2, var(--b)); }
.cluster.tr { top: calc(var(--gap) + var(--safe-t)); right: calc(var(--gap) + var(--safe-r)); }
.cluster.br { right: calc(var(--gap) + var(--safe-r)); bottom: calc(var(--gap) + var(--safe-b)); display: grid; grid-template-columns: repeat(2, auto); justify-items: end; align-items: end; }
.touch-only { display: none; }
body.touch .touch-only { display: inline-flex; }
.drive-only { display: none; }
body.driving .drive-only { display: inline-flex; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 2px rgba(43, 26, 94, 0.55); border-radius: 2px; }
#crosshair::before { left: 50%; top: 0; width: 3px; height: 100%; transform: translateX(-50%); }
#crosshair::after { top: 50%; left: 0; height: 3px; width: 100%; transform: translateY(-50%); }

#hotbar { position: absolute; left: 50%; bottom: calc(var(--gap) + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; padding: 8px;
  background: rgba(60, 30, 130, 0.55); border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 26px; backdrop-filter: blur(6px); max-width: calc(100vw - 2 * (var(--gap) + var(--safe-l))); overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
#hotbar::-webkit-scrollbar { display: none; }
.slot { flex: none; width: var(--slot); height: var(--slot); border-radius: 18px; background: rgba(255, 255, 255, 0.22); border: 4px solid transparent;
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.slot img { width: 86%; height: 86%; image-rendering: pixelated; pointer-events: none; }
.slot.sel { border-color: #fff; background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 3px var(--pink), 0 0 18px 4px rgba(255, 255, 255, 0.8); transform: translateY(-6px) scale(1.08); }
#tool-badge { position: absolute; left: 50%; bottom: calc(var(--b) * 1.4 + var(--gap) * 3 + var(--safe-b)); transform: translateX(-50%); font-size: calc(var(--b) * 0.7);
  background: #fff; border-radius: 50%; width: calc(var(--b) * 1.1); height: calc(var(--b) * 1.1); display: grid; place-items: center; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3); border: 4px solid var(--pink); }
#rings { position: absolute; top: calc(var(--gap) + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 5px; padding: 8px 12px; background: rgba(60, 30, 130, 0.5);
  border-radius: 20px; border: 3px solid rgba(255, 255, 255, 0.85); }
#rings i { width: clamp(12px, 2.4vmin, 22px); height: clamp(12px, 2.4vmin, 22px); border-radius: 50%; border: 4px solid rgba(255, 220, 90, 0.35); }
#rings i.f { border-color: #ffd23f; box-shadow: 0 0 8px #ffd23f; background: radial-gradient(circle, transparent 40%, rgba(255, 210, 60, 0.35) 41%); }
.parent-btn { position: absolute; right: calc(8px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); width: 30px; height: 30px; font-size: 16px; opacity: 0.45; background: rgba(255, 255, 255, 0.25);
  border: 0; border-radius: 50%; padding: 0; display: none; }
body.touch .parent-btn { width: 44px; height: 44px; font-size: 20px; }
#title-parent { display: block; position: absolute; }
#debug { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); color: #fff; font: 12px/1.4 monospace; background: rgba(0, 0, 0, 0.55); padding: 6px 8px; border-radius: 8px; white-space: pre; }

/* touch helpers */
#joy-base, #joy-knob { position: fixed; display: none; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 4; }
#joy-base { width: 130px; height: 130px; background: rgba(255, 255, 255, 0.18); border: 4px solid rgba(255, 255, 255, 0.6); }
#joy-knob { width: 62px; height: 62px; background: radial-gradient(circle at 35% 30%, #fff, var(--teal)); border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
#hold-ring { position: fixed; display: none; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; pointer-events: none; z-index: 4; --p: 0deg;
  background: conic-gradient(var(--pink) var(--p), rgba(255, 255, 255, 0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; }
#flash.go { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

/* ---------- idea bubble ---------- */
.bubble { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 12; background: #fff; border: 6px solid var(--purple); border-radius: 48px; padding: 18px 28px 16px;
  box-shadow: 0 12px 30px rgba(30, 10, 80, 0.4); text-align: center; }
.bubble::after { content: ""; position: absolute; left: 14%; bottom: -26px; width: 28px; height: 28px; background: #fff; border: 6px solid var(--purple); border-top: 0; border-left: 0; border-radius: 0 0 14px 0; transform: rotate(45deg) skew(10deg, 10deg); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.idea-icons { font-size: clamp(54px, 13vmin, 120px); line-height: 1.1; letter-spacing: 0.1em; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.idea-row { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 8px; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(40, 20, 100, 0.55); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 14px; }
.sheet { position: relative; width: min(920px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(180deg, #fff, #f3eaff); border: 6px solid #fff; border-radius: 36px;
  padding: calc(var(--b) * 0.9) 18px 18px; box-shadow: 0 16px 40px rgba(20, 5, 70, 0.5); -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sheet .close { position: absolute; top: 10px; right: 10px; width: calc(var(--b) * 0.8); height: calc(var(--b) * 0.8); font-size: calc(var(--b) * 0.45); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(68px, 13vmin, 112px), 1fr)); gap: 12px; }
.cell { aspect-ratio: 1; border-radius: 24px; border: 4px solid #fff; background: linear-gradient(160deg, #e7dcff, #ffe3f3); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 0 rgba(90, 47, 201, 0.25); font-size: clamp(34px, 8vmin, 64px); touch-action: manipulation; }
.cell:active { transform: scale(0.93); }
.cell img { width: 80%; height: 80%; image-rendering: pixelated; pointer-events: none; }
.cell.sel { border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink); }
.grid.photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.photos .cell { aspect-ratio: 4/3; padding: 0; overflow: hidden; }
.grid.photos img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.sheet.photo { width: min(900px, 100%); text-align: center; padding-top: 18px; }
.sheet.photo img { max-width: 100%; max-height: 62vh; border-radius: 20px; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.sheet.gate { width: min(420px, 100%); text-align: center; padding-top: calc(var(--b) * 1.1); }
.gate-hold { margin: 10px auto; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-size: 64px; position: relative; background: #fff; border: 6px solid var(--purple); }
.gate-hold i { position: absolute; inset: -6px; border-radius: 50%; --p: 0deg; background: conic-gradient(var(--pink) var(--p), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }

/* ---------- title screen ---------- */
#title { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.0), rgba(80, 30, 160, 0.38) 70%), linear-gradient(180deg, rgba(143, 91, 255, 0.55), rgba(255, 95, 179, 0.25) 55%, rgba(20, 211, 196, 0.4)); transition: opacity 0.5s; }
#title.gone { opacity: 0; pointer-events: none; }
#title h1 { margin: 0; font-size: clamp(54px, 15vmin, 168px); line-height: 1; font-weight: 900; letter-spacing: 0.01em; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.04em; padding: 0 12px; }
#title h1 span { display: inline-block; color: var(--c); -webkit-text-stroke: clamp(4px, 1vmin, 10px) #fff; paint-order: stroke fill; text-shadow: 0 0.06em 0 rgba(43, 26, 94, 0.35), 0 0.12em 0.25em rgba(43, 26, 94, 0.35); animation: hop 2.2s ease-in-out infinite; animation-delay: var(--d); }
#title h1 .gap { width: 0.35em; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-0.12em) rotate(-3deg); } }
.play { appearance: none; border: 8px solid #fff; background: linear-gradient(160deg, #6ff0e3, var(--teal) 55%, var(--teal-d)); width: clamp(120px, 26vmin, 240px); height: clamp(120px, 26vmin, 240px); border-radius: 50%;
  font-size: clamp(60px, 13vmin, 120px); color: #fff; cursor: pointer; box-shadow: 0 10px 0 rgba(0, 0, 0, 0.25), 0 18px 40px rgba(30, 10, 80, 0.45); animation: throb 1.6s ease-in-out infinite; display: grid; place-items: center; padding: 0 0 0 0.08em; }
.play:active { transform: translateY(8px) scale(0.96); }
.play[disabled] { filter: grayscale(0.6); animation: none; opacity: 0.6; }
@keyframes throb { 50% { transform: scale(1.07); } }
.loading { font-size: 40px; animation: bob 1s infinite; }
.cubes i { position: absolute; width: clamp(40px, 9vmin, 90px); height: clamp(40px, 9vmin, 90px); border-radius: 16%; border: 4px solid #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2); animation: float 7s ease-in-out infinite; }
.cubes i:nth-child(1) { left: 8%; top: 14%; background: var(--purple); }
.cubes i:nth-child(2) { right: 9%; top: 18%; background: var(--pink); animation-delay: -2s; }
.cubes i:nth-child(3) { left: 14%; bottom: 14%; background: var(--teal); animation-delay: -4s; }
.cubes i:nth-child(4) { right: 12%; bottom: 16%; background: var(--yellow); animation-delay: -1s; }
.cubes i:nth-child(5) { left: 44%; top: 6%; background: var(--teal); width: 5vmin; height: 5vmin; animation-delay: -3s; }
.cubes i:nth-child(6) { left: 84%; bottom: 40%; background: var(--purple); width: 5vmin; height: 5vmin; animation-delay: -5s; }
@keyframes float { 50% { transform: translateY(-18px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; } }

/* ---------- responsive: tablets keep the full layout, phones collapse extras into a drawer ---------- */
.compact-only { display: none; }
.drawer { position: absolute; top: calc(var(--b) + var(--gap) * 2 + var(--safe-t)); right: calc(var(--gap) + var(--safe-r)); display: none; grid-template-columns: repeat(3, var(--b)); gap: var(--gap); padding: var(--gap);
  background: rgba(60, 30, 130, 0.78); border: 4px solid #fff; border-radius: 26px; pointer-events: auto; z-index: 8; }
body.compact .compact-only { display: inline-flex; }
body.compact .drawer.open { display: grid; }
.drawer .parent-btn { position: static; display: inline-flex; align-items: center; justify-content: center; width: var(--b); height: var(--b); font-size: calc(var(--b) * 0.5); opacity: 1; border-radius: 26%;
  background: linear-gradient(160deg, #c9c3dd, #8f88aa); border: 4px solid #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28); }
#rings { top: calc(var(--b) * 1.3 + var(--gap) * 2 + var(--safe-t)); }
body.portrait .cluster.br { bottom: calc(var(--hb) + var(--gap) + var(--safe-b)); }
body.portrait .cluster.tools { top: calc(var(--b) * 1.3 + var(--gap) * 3 + var(--safe-t)); }
body.compact { --b: 46px; --gap: 6px; --slot: 46px; --hb: 74px; }
body.compact .btn { border-width: 3px; }
body.compact .btn.big { width: calc(var(--b) * 1.25); height: calc(var(--b) * 1.25); }
body.compact .cluster.tools { grid-template-columns: var(--b); top: calc(var(--b) * 1.25 + var(--gap) * 3 + var(--safe-t)); }
body.compact #hotbar { padding: 5px; gap: 4px; border-width: 3px; border-radius: 22px; }
body.compact .slot { border-width: 3px; border-radius: 14px; }
body.compact:not(.portrait) #hotbar { max-width: calc(100vw - 2 * (var(--b) * 2.4 + var(--gap) * 4 + var(--safe-l))); }
body.compact #rings { padding: 5px 8px; gap: 3px; }
body.compact #rings i { width: 13px; height: 13px; border-width: 3px; }
body.compact #tool-badge { bottom: calc(var(--hb) + var(--gap) + var(--safe-b)); width: calc(var(--b) * 0.9); height: calc(var(--b) * 0.9); font-size: calc(var(--b) * 0.55); }
body.compact .bubble { top: 12%; padding: 10px 18px; }
body.compact .sheet { padding-top: calc(var(--b) * 0.95); }
body.compact #joy-base { width: 110px; height: 110px; }
@media (max-height: 460px) { .sheet { border-radius: 24px; padding-left: 10px; padding-right: 10px; } .grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; } .idea-icons { font-size: 54px; } }
#hud > .parent-btn { display: block; }
#hud > .parent-btn { right: auto; left: calc(8px + var(--safe-l)); }

/* ---------- avatar dress-up ---------- */
.avatar-sheet { width: min(860px, 100%); }
.av-grid { display: grid; grid-template-columns: minmax(150px, 0.8fr) 1.4fr; gap: 16px; align-items: center; }
#avatar-canvas { width: 100%; max-height: 62vh; aspect-ratio: 300 / 380; border-radius: 28px; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(30, 10, 80, 0.3); background: linear-gradient(#c8a6ff, #ffd0ec); }
.av-rows { display: flex; flex-direction: column; gap: 12px; }
.sw-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: clamp(38px, 8vmin, 58px); height: clamp(38px, 8vmin, 58px); border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(60, 30, 130, 0.35); padding: 0; cursor: pointer; touch-action: manipulation; }
.sw.wide { border-radius: 16px; width: clamp(44px, 9vmin, 66px); height: clamp(54px, 11vmin, 82px); background-size: cover; background-position: center; background-color: #e5d8ff; }
.sw.sel { outline: 5px solid var(--pink); transform: scale(1.12); }
@media (max-width: 560px) { .av-grid { grid-template-columns: 1fr; } #avatar-canvas { max-height: 38vh; margin: 0 auto; width: auto; } }
.vol-row { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 4px 0 8px; }
.vol-row input { flex: 1; min-width: 0; height: 36px; accent-color: #9b5cff; }
/* ===== story + help (js/story.js, js/help.js). Self-contained; safe to merge. ===== */
.zw-story { position: fixed; inset: 0; z-index: 26; display: grid; place-items: center; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.15), rgba(60, 20, 140, 0.8)), rgba(40, 20, 100, 0.85); backdrop-filter: blur(6px); }
.zw-card { position: relative; width: min(980px, 100%); max-height: 100%; display: grid; grid-template-columns: 1fr; gap: 12px; padding: 14px; background: linear-gradient(180deg, #fff, #f3eaff); border: 6px solid #fff; border-radius: 36px; box-shadow: 0 16px 40px rgba(20, 5, 70, 0.5); }
.zw-pic { border-radius: 24px; overflow: hidden; border: 5px solid var(--purple); background: #bfe6ff; aspect-ratio: 4 / 3; max-height: 52vh; justify-self: center; width: min(100%, calc(52vh * 4 / 3)); }
.zw-pic img, .zw-dpic img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.zw-side { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; }
.zw-say { margin: 0; text-align: center; color: var(--ink); font-weight: 800; font-size: clamp(17px, 3.4vmin, 30px); line-height: 1.25; text-wrap: balance; }
.zw-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.zw-dots i { width: 12px; height: 12px; border-radius: 50%; background: #d7c8ff; border: 2px solid #fff; }
.zw-dots i.on { background: var(--pink); transform: scale(1.3); }
.zw-nav { display: flex; gap: 18px; align-items: center; justify-content: center; }
.zw-skip { position: absolute; top: -14px; right: -10px; width: 48px; height: 48px; font-size: 22px; }
.zw-story.pop .zw-pic { animation: zwpop 0.35s ease-out; }
@keyframes zwpop { 0% { transform: scale(0.92); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
@media (orientation: landscape) and (max-height: 600px) {
  .zw-card { grid-template-columns: auto 1fr; align-items: center; padding: 10px; border-radius: 28px; }
  .zw-pic { max-height: none; width: min(56vw, calc((100vh - 60px) * 4 / 3)); }
  .zw-say { font-size: clamp(15px, 4.2vh, 24px); }
  .zw-nav .btn.big { width: 62px; height: 62px; font-size: 32px; }
  .zw-skip { top: -10px; right: -6px; width: 42px; height: 42px; }
}
.zw-help .sheet { padding-top: calc(var(--b) * 0.95); }
.zw-help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(84px, 15vmin, 128px), 1fr)); gap: 12px; }
.zw-group { grid-column: 1 / -1; font-size: clamp(28px, 6vmin, 44px); line-height: 1; padding: 4px 8px; border-radius: 16px; background: linear-gradient(90deg, #e7dcff, #ffe3f3, #d6fbf6); text-align: left; }
.zw-hcard { appearance: none; border: 4px solid #fff; border-radius: 24px; background: linear-gradient(160deg, #e7dcff, #ffe3f3); box-shadow: 0 4px 0 rgba(90, 47, 201, 0.25); padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; touch-action: manipulation; font-family: inherit; color: var(--ink); }
.zw-hcard:active { transform: scale(0.94); }
.zw-hcard .btn, .zw-hcard .zw-blk { flex: none; }
.zw-blk { width: var(--b); height: var(--b); image-rendering: pixelated; }
.zw-cap { font-size: 12px; font-weight: 700; line-height: 1.1; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; opacity: 0.8; }
.zw-detail { display: grid; grid-template-columns: 1fr; gap: 12px; justify-items: center; }
.zw-dpic { width: min(100%, 520px, calc(50vh * 4 / 3)); aspect-ratio: 4 / 3; border-radius: 24px; overflow: hidden; border: 5px solid var(--purple); background: #bfe6ff; }
.zw-dpic.icon { display: grid; place-items: center; background: linear-gradient(160deg, #e7dcff, #ffe3f3); }
.zw-dpic.icon .btn { width: 38%; height: auto; aspect-ratio: 1; font-size: clamp(48px, 12vmin, 96px); }
.zw-dpic.icon .zw-blk { width: 46%; height: auto; }
.zw-dside { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.zw-toast { position: fixed; left: 50%; bottom: calc(var(--hb) + var(--gap) * 4 + var(--safe-b)); transform: translateX(-50%); z-index: 14; display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 24px)); padding: 8px 18px 8px 8px; background: #fff; border: 5px solid var(--pink); border-radius: 30px; box-shadow: 0 10px 24px rgba(30, 10, 80, 0.4); pointer-events: none; animation: zwpop 0.35s ease-out; }
.zw-toast img { width: 88px; height: 66px; border-radius: 16px; image-rendering: pixelated; flex: none; border: 3px solid var(--purple); }
.zw-toast span { color: var(--ink); font-weight: 800; font-size: clamp(15px, 3vmin, 22px); line-height: 1.2; }
.zw-gate-voice { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.zw-pill { appearance: none; border: 4px solid #fff; border-radius: 999px; padding: 10px 18px; font: 800 18px inherit; font-family: inherit; color: #fff; background: linear-gradient(160deg, #6ff0e3, var(--teal-d)); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); cursor: pointer; }
.zw-pill.off { background: linear-gradient(160deg, #c9c3dd, #8f88aa); }
.zw-small { font-size: 13px; color: var(--ink); font-weight: 700; }
body.compact .zw-toast { bottom: calc(var(--hb) + var(--gap) * 8 + var(--safe-b)); }
/* ===== end story + help ===== */
