/* Playground — one big poster + animated stickers; unwrap gift; SFX; adult easter egg */
:root {
  --sky: #5ec8f0;
  --sun: #ffd23f;
  --coral: #ff5c5c;
  --lime: #7be07a;
  --grape: #9b6bff;
  --ink: #1a1a2e;
  --cream: #fff8e8;
  --outline: #1a1a2e;
  --chubby: "Fredoka", "Noto Sans TC", system-ui, sans-serif;
  --sans: "Noto Sans TC", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }
html, body.home { height: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--sans);
  background: #1a1a2e; color: var(--ink); line-height: 1.55;
}
.skip {
  position: absolute; left: -999px; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 99;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.preview-badge {
  font-size: 0.75rem; font-weight: 700; background: var(--sun);
  border: 3px solid var(--outline); border-radius: 999px; padding: 0.25rem 0.7rem;
  box-shadow: 3px 3px 0 var(--outline);
}
.float-badge {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 5;
}

/* —— Homepage: ONE big poster —— */
.poster-stage {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch; justify-content: center;
  padding: 0; overflow: hidden;
}
.poster {
  position: relative; flex: 1; width: 100%;
  background:
    radial-gradient(circle at 18% 22%, #ffe08a 0%, transparent 32%),
    radial-gradient(circle at 85% 12%, #a8f0ff 0%, transparent 28%),
    radial-gradient(circle at 70% 88%, #ffb4c8 0%, transparent 34%),
    linear-gradient(180deg, #7ed6f7 0%, #d9f4ff 38%, #fff3d6 70%, #f5c98b 100%);
  border: 0;
  overflow: hidden;
}
.poster-sky {
  position: absolute; inset: 0 0 35% 0;
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,0.55) 0 8%, transparent 9%),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4) 0 5%, transparent 6%);
  pointer-events: none;
}
.poster-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 18%;
  background: linear-gradient(180deg, transparent, rgba(139, 90, 43, 0.25));
  pointer-events: none;
}
.poster-title {
  position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 2; width: min(90%, 28rem);
}
.poster-q {
  display: inline-grid; place-items: center;
  width: 3.4rem; height: 3.4rem; border-radius: 40% 60% 55% 45%;
  background: var(--coral); border: 4px solid var(--outline); color: #fff;
  font-family: var(--chubby); font-size: 1.8rem; font-weight: 700;
  box-shadow: 4px 4px 0 var(--outline);
  animation: wiggle 2.8s ease-in-out infinite;
}
.poster-title h1 {
  margin: 0.55rem 0 0.2rem; font-family: var(--chubby);
  font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1;
  text-shadow: 3px 3px 0 rgba(255,255,255,0.7);
}
.poster-title p {
  margin: 0; font-family: var(--chubby); font-size: 1.1rem; font-weight: 600; color: #444;
}

.sticker-field {
  position: absolute; inset: 0; z-index: 3;
}
.sticker {
  position: absolute; width: min(11.5rem, 28vw); min-width: 8.5rem;
  text-decoration: none; color: inherit; cursor: pointer;
  background: #fff; border: 4px solid var(--outline); border-radius: 1.1rem;
  padding: 0.55rem 0.55rem 0.65rem;
  box-shadow: 5px 5px 0 var(--outline);
  transform: rotate(var(--rot, -4deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: sticker-float 3.2s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.sticker:nth-child(1) { top: 38%; left: 8%; --rot: -8deg; --delay: 0s; }
.sticker:nth-child(2) { top: 42%; right: 7%; left: auto; --rot: 6deg; --delay: 0.4s; }
.sticker:nth-child(3) { bottom: 10%; left: 50%; transform: translateX(-50%) rotate(var(--rot, -2deg)); --rot: -2deg; --delay: 0.8s; }
.sticker:hover {
  transform: rotate(0deg) scale(1.06) translateY(-4px);
  z-index: 4;
}
.sticker:nth-child(3):hover {
  transform: translateX(-50%) rotate(0deg) scale(1.06) translateY(-4px);
}
.sticker.is-unwrap {
  animation: unwrap 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  z-index: 6;
}
.sticker-tape {
  position: absolute; top: -0.45rem; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 2.4rem; height: 0.7rem; background: rgba(255, 210, 63, 0.85);
  border: 2px solid var(--outline); border-radius: 2px;
}
.sticker img {
  width: 100%; aspect-ratio: 1.1; object-fit: contain; display: block;
  background: var(--cream); border: 3px solid var(--outline); border-radius: 0.75rem;
}
.sticker-topic {
  display: inline-block; margin-top: 0.4rem; font-family: var(--chubby);
  font-size: 0.78rem; background: var(--sun); border: 2px solid var(--outline);
  border-radius: 999px; padding: 0.05rem 0.45rem;
}
.sticker h2 {
  margin: 0.3rem 0 0; font-family: var(--chubby); font-size: 0.95rem; line-height: 1.25;
}
.sticker-dots {
  display: flex; gap: 0.18rem; margin-top: 0.35rem;
}
.sticker-dots i {
  width: 0.45rem; height: 0.45rem; border-radius: 50%; border: 2px solid var(--outline);
  display: inline-block; background: #fff;
}
.sticker-dots i.on { background: var(--lime); }
.sticker .asked-mini {
  position: absolute; top: 0.4rem; right: 0.4rem;
  background: var(--coral); color: #fff; border: 2px solid var(--outline);
  border-radius: 0.35rem; font-size: 0.65rem; font-weight: 700;
  padding: 0.05rem 0.3rem; transform: rotate(12deg);
}

.corner-controls {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 8;
  display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end;
}
.corner-btn {
  font-family: var(--chubby); font-size: 0.85rem; font-weight: 700;
  background: #fff; border: 3px solid var(--outline); border-radius: 999px;
  padding: 0.35rem 0.7rem; cursor: pointer; box-shadow: 2px 2px 0 var(--outline);
}
.corner-btn.accent { background: var(--lime); }
.corner-btn[aria-pressed="true"] { background: #ddd; }

.catalog-drawer {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(26,26,46,0.45);
  display: flex; justify-content: flex-end;
}
.catalog-drawer[hidden] { display: none; }
.drawer-inner {
  width: min(22rem, 92vw); height: 100%; background: #fff8e8;
  border-left: 4px solid var(--outline); padding: 1rem;
  overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,0.2);
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; font-family: var(--chubby); font-size: 1.15rem;
}
.toys { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.toy {
  font-family: var(--chubby); font-size: 0.9rem; font-weight: 600;
  border: 3px solid var(--outline); border-radius: 1.2rem;
  padding: 0.4rem 0.75rem; cursor: pointer; background: #fff;
  box-shadow: 2px 2px 0 var(--outline);
}
.toy[aria-pressed="true"] { background: var(--sun); outline: 3px solid var(--coral); outline-offset: 1px; }
.find {
  display: flex; align-items: center; background: #fff;
  border: 3px solid var(--outline); border-radius: 999px; margin-bottom: 0.5rem;
}
.find input {
  flex: 1; border: none; background: transparent; font: inherit; font-weight: 600;
  padding: 0.55rem 0.9rem; outline: none;
}
.clear-x {
  border: 2px solid var(--outline); background: var(--coral); color: #fff;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; margin-right: 0.35rem; cursor: pointer;
}
.count { font-weight: 700; font-size: 0.85rem; margin: 0 0 0.5rem; }
.catalog-list { display: flex; flex-direction: column; gap: 0.45rem; }
.catalog-item {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 3px solid var(--outline); border-radius: 0.9rem;
  padding: 0.55rem 0.7rem; font-family: var(--chubby); font-size: 0.95rem;
  box-shadow: 2px 2px 0 var(--outline);
}
.empty-mini { text-align: center; padding: 1rem; color: #666; font-weight: 700; }

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(6deg); }
}
@keyframes sticker-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}
@keyframes unwrap {
  0% { transform: rotate(var(--rot, 0deg)) scale(1); }
  35% { transform: rotate(12deg) scale(1.12); }
  70% { transform: rotate(-8deg) scale(1.18); }
  100% { transform: rotate(0deg) scale(1.4); opacity: 0; }
}

/* —— Detail: gift unwrap / piece by piece —— */
.detail {
  background: linear-gradient(180deg, #ffe8a3 0%, #fff8e8 40%, #e8f9ff 100%);
}
.dig-shell { width: min(720px, calc(100% - 1.25rem)); margin: 0 auto; padding: 1rem 0 3rem; }
.dig-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 0.5rem;
}
.back-pill {
  font-family: var(--chubby); font-weight: 700; text-decoration: none; color: var(--ink);
  background: #fff; border: 3px solid var(--outline); border-radius: 999px;
  padding: 0.4rem 0.9rem; box-shadow: 3px 3px 0 var(--outline);
}
.dig-tools { display: flex; gap: 0.35rem; align-items: center; }

.gift-wrap {
  position: relative; margin: 0 auto 1rem; max-width: 22rem;
  background: #fff; border: 4px solid var(--outline); border-radius: 1.4rem;
  padding: 0.85rem; box-shadow: 6px 6px 0 var(--outline);
  overflow: hidden;
}
.gift-wrap.is-burst { animation: burst 0.5s ease; }
.gift-bow {
  position: absolute; top: -0.2rem; left: 50%; transform: translateX(-50%);
  font-size: 1.8rem; z-index: 2; filter: drop-shadow(2px 2px 0 var(--outline));
}
.stage-art {
  width: 100%; max-height: 220px; object-fit: contain; display: block; margin: 0 auto;
  background: var(--cream); border: 3px solid var(--outline); border-radius: 1rem;
}
.dig-kicker {
  margin: 0.85rem 0 0.2rem; font-family: var(--chubby); font-size: 0.95rem; color: #555;
}
.dig-title {
  margin: 0; font-family: var(--chubby); font-size: clamp(1.45rem, 4vw, 2rem); line-height: 1.25;
}
.dig-note { margin: 0.35rem 0 0; font-weight: 700; color: var(--grape); }

.layer-track {
  display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.85rem 0 0.35rem;
  scrollbar-width: none;
}
.layer-track::-webkit-scrollbar { display: none; }
.notch {
  flex: 0 0 auto; font-family: var(--chubby); font-size: 0.82rem; font-weight: 600;
  border: 3px solid var(--outline); border-radius: 999px; padding: 0.35rem 0.7rem;
  background: #fff; cursor: pointer; white-space: nowrap;
}
.notch.is-locked { opacity: 0.45; background: #eee; }
.notch.is-on {
  background: var(--sun); box-shadow: 3px 3px 0 var(--outline); transform: translateY(-2px);
}

.pieces { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.35rem; }
.piece {
  background: #fff; border: 4px solid var(--outline); border-radius: 1.2rem;
  padding: 1rem 1rem 1.1rem; box-shadow: 5px 5px 0 var(--outline);
  animation: pop-piece 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.piece .lead {
  margin: 0 0 0.25rem; font-family: var(--chubby); font-size: 0.85rem; color: #666;
}
.piece h2 {
  margin: 0 0 0.45rem; font-family: var(--chubby); font-size: 1.25rem;
}
.piece p { margin: 0; font-size: 1.05rem; font-weight: 500; }

.dig-btn {
  display: block; width: 100%; margin-top: 0.85rem;
  font-family: var(--chubby); font-size: 1.15rem; font-weight: 700;
  background: var(--coral); color: #fff; border: 4px solid var(--outline);
  border-radius: 1.2rem; padding: 0.85rem 1rem; cursor: pointer;
  box-shadow: 5px 5px 0 var(--outline);
}
.dig-btn:hover { transform: translate(-1px, -2px); }
.dig-btn:disabled { background: #bbb; cursor: default; transform: none; }

/* Adult easter egg at bottom */
.easter {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 3px dashed rgba(26,26,46,0.2);
  text-align: center;
}
.easter-hint {
  font-size: 0.8rem; color: #999; font-weight: 600; margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
}
.easter-door {
  font-family: var(--chubby); font-size: 0.95rem; font-weight: 700;
  background: transparent; border: 2px dashed #bbb; color: #888;
  border-radius: 999px; padding: 0.45rem 1rem; cursor: pointer;
}
.easter-door:hover { border-color: var(--grape); color: var(--grape); }
.easter-panel {
  margin-top: 0.75rem; text-align: left;
  background: #f3f0ff; border: 3px solid var(--outline); border-radius: 1rem;
  padding: 0.85rem;
}
.easter-panel[hidden] { display: none; }
.adult-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.35rem; }
.adult-item {
  border: 3px solid var(--outline); border-radius: 1rem; background: #fff; overflow: hidden;
}
.adult-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; background: none; border: none; padding: 0.65rem 0.8rem;
  font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.adult-panel { padding: 0 0.8rem 0.75rem; font-weight: 500; }
.adult-panel[hidden] { display: none; }
.adult-hint { font-size: 0.85rem; font-weight: 700; color: #666; margin: 0 0 0.4rem; }

.ask-sticker {
  margin-top: 0.9rem; font-family: var(--chubby); font-size: 1.2rem; font-weight: 700;
  background: var(--sun); border: 4px solid var(--outline); border-radius: 1rem;
  padding: 0.75rem 1.2rem; cursor: pointer; box-shadow: 4px 4px 0 var(--outline);
  transform: rotate(-2deg);
}
.ask-sticker[aria-pressed="true"] {
  background: var(--lime); transform: rotate(3deg) scale(1.05);
  animation: stamp 0.35s ease;
}
.storage-note { font-size: 0.78rem; font-weight: 600; color: #777; margin-top: 0.45rem; }

.refs {
  margin-top: 1.25rem; background: #fff; border: 3px dashed var(--outline);
  border-radius: 1rem; padding: 0.65rem 0.9rem; font-size: 0.85rem;
}
.refs summary { cursor: pointer; font-weight: 700; }
.refs a { color: #2563eb; }

@keyframes pop-piece {
  from { opacity: 0; transform: scale(0.85) translateY(16px) rotate(-2deg); }
  to { opacity: 1; transform: none; }
}
@keyframes burst {
  0% { transform: scale(1); }
  40% { transform: scale(1.04) rotate(-1deg); }
  100% { transform: scale(1); }
}
@keyframes stamp {
  0% { transform: scale(1.3) rotate(-8deg); }
  100% { transform: rotate(3deg) scale(1.05); }
}

@media (max-width: 640px) {
  .sticker { width: min(9.5rem, 42vw); min-width: 7.5rem; }
  .sticker h2 { font-size: 0.82rem; }
  .sticker:nth-child(1) { top: 34%; left: 3%; }
  .sticker:nth-child(2) { top: 36%; right: 3%; }
  .sticker:nth-child(3) { bottom: 8%; }
}

@media (prefers-reduced-motion: reduce) {
  *, .poster-q, .sticker, .piece, .ask-sticker, .gift-wrap {
    animation: none !important; transition: none !important;
  }
}
