/* Doodle World place screens (templates/world_zone.html). Tokens and the font come from the mini-game kit. */
body.zp-body { min-height: 100%; background: var(--paper); background-image: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--zone) 55%, #fff) 0, var(--paper) 60%); background-attachment: fixed; -webkit-user-select: auto; user-select: auto; }
.zp-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: rgba(255, 253, 247, .9); backdrop-filter: blur(6px); }
.zp-name { flex: 1; margin: 0; font-size: clamp(24px, 5vw, 40px); line-height: 1.05; text-align: center; letter-spacing: .01em; }
.zp-map, .zp-home { flex: none; text-decoration: none; }
.zp-bar::after { content: ""; width: var(--hit); flex: none; }
.zp-main { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

/* the place */
.zp-place { margin: 6px 0 18px; }
.zp-scene { position: relative; aspect-ratio: 4 / 3; max-height: 62vh; margin: 0 auto; border: 4px solid var(--ink); border-radius: 30px; overflow: hidden; box-shadow: 0 6px 0 var(--ink);
  background: radial-gradient(ellipse at 50% 105%, color-mix(in srgb, var(--zone) 85%, #fff) 0 42%, transparent 43%), linear-gradient(180deg, #F2FAFF 0, color-mix(in srgb, var(--zone) 35%, #fff) 100%); }
@media (min-width: 760px) { .zp-scene { aspect-ratio: 16 / 9; } }
.zp-landmark { position: absolute; left: 50%; top: 48%; height: 80%; width: auto; max-width: 70%; object-fit: contain; transform: translate(-50%, -50%); cursor: pointer; -webkit-user-drag: none; }
.zp-res { position: absolute; transform: translate(-50%, -100%); padding: 0; border: 0; background: none; cursor: pointer; height: 30%; min-height: 64px; min-width: 64px; display: flex; align-items: flex-end; justify-content: center; z-index: 3; }
.zp-res img { height: 100%; width: auto; max-width: 26vw; object-fit: contain; pointer-events: none; animation: zp-idle 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); transform-origin: 50% 100%; filter: drop-shadow(0 4px 0 rgba(26, 26, 26, .18)); }
.zp-res--neighbour { height: 24%; }
.zp-res:focus-visible, .zp-tile:focus-visible, .zp-card:focus-visible, .zp-sticker:focus-visible { outline: 5px solid var(--blue); outline-offset: 4px; border-radius: 18px; }
.zp-hop img { animation: zp-hop .6s cubic-bezier(.3, 1.6, .5, 1); }
.zp-spin img { animation: zp-spin .7s ease-in-out; }
.zp-wobble, .zp-wobble img { animation: zp-wob .6s ease-in-out; }
.zp-squash img { animation: zp-squash .5s ease; }
.zp-landmark.zp-wobble { animation: zp-lmwob .6s ease-in-out; }
.zp-bubble { position: absolute; z-index: 8; margin: 0; transform: translate(-50%, -100%) scale(.6); opacity: 0; pointer-events: none; max-width: min(70%, 280px);
  padding: 8px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; font-size: 18px; line-height: 1.2; text-align: center; transition: transform .2s ease, opacity .2s ease; }
.zp-bubble.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.zp-tuffet { position: absolute; transform: translate(-50%, -50%); width: 13%; min-width: 64px; min-height: 64px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 4; clip-path: inset(0 0 42% 0); }
.zp-tuffet img { width: 100%; height: auto; animation: zp-peek 4s ease-in-out infinite; pointer-events: none; }
.zp-tuffet.is-found { clip-path: none; }
.zp-tuffet.is-found img { animation: zp-hop .6s cubic-bezier(.3, 1.6, .5, 1) 2; }
.zp-amb { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.zp-amb__one { position: absolute; width: 7%; height: auto; opacity: .9; animation: zp-float 9s ease-in-out infinite; }
.zp-amb--bubble { animation-name: zp-rise; animation-duration: 7s; width: 5%; }
.zp-amb--star { animation-name: zp-twinkle; animation-duration: 4s; width: 5%; }
.zp-amb--cloud { animation-name: zp-drift; animation-duration: 24s; width: 12%; }
.zp-amb--leaf { animation-name: zp-fall; animation-duration: 10s; }

/* the five things to do */
.zp-do { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 2vw, 18px); max-width: 860px; margin: 0 auto; }
.zp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; min-height: 64px; background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 5px 0 var(--ink);
  color: var(--ink); text-decoration: none; font-size: clamp(14px, 2.6vw, 22px); transition: transform .12s ease, box-shadow .12s ease; }
.zp-tile svg { width: min(100%, 84px); height: auto; aspect-ratio: 1; }
.zp-tile:hover { transform: translateY(-3px) rotate(-1deg); }
.zp-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.zp-tile--watch { background: #E4F0FF; } .zp-tile--colour { background: #FFE7E2; } .zp-tile--play { background: #E3F6E8; }
.zp-tile--explore { background: #FFF0DD; } .zp-tile--stickers { background: #FFE6F1; }

/* panels */
body[data-view]:not([data-view="home"]) .zp-place, body[data-view]:not([data-view="home"]) .zp-do { display: none; }
body[data-view="explore"] .zp-place { display: none; }
.zp-panel { padding-top: 4px; }
.zp-panel__h { margin: 4px 0 14px; font-size: clamp(26px, 5vw, 38px); text-align: center; outline: none; }
.zp-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.zp-grid--watch { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.zp-grid--pages { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.zp-grid--play { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.zp-grid--stickers { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.zp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 10px; background: #fff; border: 4px solid var(--ink); border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink); color: var(--ink); text-decoration: none; font: inherit; font-size: 18px; cursor: pointer; text-align: center; transition: transform .12s ease; box-sizing: border-box; }
.zp-card:hover { transform: translateY(-3px); }
.zp-card img { width: 100%; height: auto; border-radius: 12px; }
.zp-card--story img { aspect-ratio: 9 / 16; object-fit: cover; background: #DDF4FF; }
.zp-play { position: absolute; left: 50%; top: 42%; width: 64px; height: 64px; transform: translate(-50%, -50%); }
.zp-card--page img { aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.zp-card--locked img { opacity: .75; }
.zp-card__icon { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: color-mix(in srgb, var(--zone) 45%, #fff); border-radius: 16px; }
.zp-card__icon img { width: 78%; height: 78%; object-fit: contain; border-radius: 0; }
.zp-card--hero { background: #FFF8D6; }
.zp-card__t { line-height: 1.15; }
.zp-tag { position: absolute; top: 8px; right: 8px; padding: 2px 10px; border: 3px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 14px; }
.zp-tag--free { background: var(--green); color: #fff; }
.zp-stars { display: flex; gap: 2px; }
.zp-star svg { width: 22px; height: 22px; fill: #EDE7DA; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.zp-star.is-on svg { fill: var(--yellow); }
.zp-note { text-align: center; font-size: 17px; margin: 18px 0 0; }
.zp-empty { display: grid; justify-items: center; gap: 8px; padding: 24px; font-size: 20px; text-align: center; }
.zp-empty svg { width: 160px; height: auto; }
.zp-textlink { color: var(--blue); }

/* stickers */
.zp-sticker { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 8px 4px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.zp-sticker__disc { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: #F3EFE6; border: 4px dashed #B9B2A3; }
.zp-sticker__disc img { width: 70%; height: 70%; object-fit: contain; filter: grayscale(1) opacity(.35); }
.zp-sticker.is-earned .zp-sticker__disc { background: #fff; border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink); transform: rotate(-4deg); }
.zp-sticker.is-earned .zp-sticker__disc img { filter: none; }
/* Grok's stickers: the line art is the "not yet" look itself (no greying), bigger in the disc; earned = coloured */
.zp-sticker--art .zp-sticker__disc img { width: 80px; height: 80px; filter: opacity(.8); }
.zp-sticker--art.is-earned .zp-sticker__disc img { filter: drop-shadow(0 2px 0 rgba(26,26,26,.25)); }
.zp-sticker__name { line-height: 1.15; text-align: center; }
.zp-how { position: sticky; bottom: 12px; margin: 16px auto 0; max-width: 420px; padding: 12px 16px; background: #fff; border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); text-align: center; font-size: 18px; }
.zp-how p { margin: 4px 0; }
.zp-how__name { font-size: 22px; }
.zp-how__go { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 16px 6px 6px; min-height: 64px; border: 4px solid var(--ink); border-radius: 999px; background: var(--yellow); color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 var(--ink); }
.zp-how__go img { width: 52px; height: 52px; object-fit: contain; }

/* explore: the scene, big */
.zp-panel--explore .zp-scene { aspect-ratio: auto; height: min(calc(100vh - 120px), 125vw); height: min(calc(100dvh - 120px), 125vw); max-height: none; }
.zp-panel--explore .zp-res { height: 24%; }

/* the story player */
.zp-player { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(26, 26, 26, .82); padding: 16px; }
.zp-player[hidden] { display: none; }
.zp-player__box { position: relative; display: grid; place-items: center; }
.zp-video { max-height: 86vh; max-height: 86dvh; max-width: calc(100vw - 32px); aspect-ratio: 9 / 16; background: #000; border: 4px solid #fff; border-radius: 22px; }
.zp-player__close { position: absolute; top: -10px; right: -10px; z-index: 2; }
.zp-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(255, 253, 247, .95); border-radius: 22px; }
.zp-end[hidden] { display: none; }
.zp-end__btn { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 160px; padding: 12px 18px; border: 4px solid var(--ink); border-radius: 24px; background: #fff; box-shadow: 0 5px 0 var(--ink);
  color: var(--ink); text-decoration: none; font: inherit; font-size: 20px; cursor: pointer; }
.zp-end__btn svg { width: 64px; height: 64px; }
.zp-end__btn[hidden] { display: none; }

/* the Doodle Club card */
.zp-club { min-height: 100vh; display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.zp-club__card { position: relative; display: grid; justify-items: center; gap: 6px; max-width: 420px; padding: 24px; background: #fff; border: 5px solid var(--ink); border-radius: 36px; box-shadow: 0 8px 0 var(--ink); text-align: center; }
.zp-club__dood { height: 140px; width: auto; }
.zp-club__lock { position: absolute; top: 96px; left: calc(50% + 26px); width: 60px; height: 60px; }
.zp-club__h { margin: 4px 0 0; font-size: 30px; }
.zp-club__p { margin: 0; font-size: 19px; }
.zp-club__back { display: grid; margin-top: 10px; text-decoration: none; }

@keyframes zp-idle { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.015); } }
@keyframes zp-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-26%) scaleY(1.05); } 70% { transform: translateY(0) scaleY(.92); } 100% { transform: none; } }
@keyframes zp-spin { 50% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes zp-wob { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes zp-lmwob { 25% { transform: translate(-50%, -50%) rotate(-3deg) scale(1.02); } 75% { transform: translate(-50%, -50%) rotate(3deg) scale(1.02); } }
@keyframes zp-squash { 30% { transform: scale(1.1, .85); } 60% { transform: scale(.94, 1.08); } }
@keyframes zp-peek { 0%, 100% { transform: translateY(18%); } 50% { transform: translateY(4%); } }
@keyframes zp-float { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 25% { transform: translate(30px, -16px) rotate(6deg); } 50% { transform: translate(60px, 4px) rotate(-4deg); } 75% { transform: translate(24px, 14px) rotate(4deg); } }
@keyframes zp-rise { from { transform: translateY(260%); opacity: 0; } 20% { opacity: .9; } to { transform: translateY(-260%); opacity: 0; } }
@keyframes zp-twinkle { 0%, 100% { transform: scale(.7); opacity: .45; } 50% { transform: scale(1); opacity: 1; } }
@keyframes zp-drift { from { transform: translateX(-60%); } to { transform: translateX(520%); } }
@keyframes zp-fall { from { transform: translateY(-120%) rotate(0); } to { transform: translateY(700%) rotate(240deg); } }

/* phones: a squarer place and the five buttons as 3 + 2, each well over 64 px */
@media (max-width: 560px) {
  .zp-scene { aspect-ratio: 1 / 1; }
  .zp-do { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .zp-tile { grid-column: span 2; font-size: 18px; padding: 10px 4px 8px; }
  .zp-tile svg { width: 64px; }
  .zp-tile:nth-child(4) { grid-column: 2 / span 2; }
  .zp-tile:nth-child(5) { grid-column: 4 / span 2; }
}
.zp-empty--club .zp-club__lock { position: static; width: 72px; height: 72px; }
