/* ======== CURIOUS WORLD ======== */
.cw-screen { display: flex; flex-direction: column; height: calc(100vh - 40px); height: calc(100dvh - 40px); min-height: 420px; position: relative; }
.cw-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.cw-top h1 { margin: 0; font-size: 1.4rem; }
.cw-hint { color: var(--color-text-muted); font-size: 0.85rem; }
/* XP chip in the top bar (cwXpChipHTML) and the "+N XP" that floats off the explorer. */
.cw-xp { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px 4px 8px; border-radius: 999px; cursor: pointer;
  background: #fff8e6; border: 2px solid #8a5a2b; color: #5a3410; font: inherit; font-size: 0.9rem; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.cw-xp img { width: 20px; height: 20px; image-rendering: pixelated; }
.cw-xp b { font-weight: 800; }
.cw-xp-float-at { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 9999; pointer-events: none; }
.cw-xp-float-at.on-chip { left: 50%; top: 0; }
.cw-xp { position: relative; }
.cw-xp-float { position: absolute; left: 0; bottom: 34px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font-weight: 900; font-size: 1rem; color: #ffe36e; text-shadow: 0 2px 0 #6b3a10, 0 0 6px rgba(0, 0, 0, 0.5); animation: cw-xp-up 1.7s ease-out forwards; }
@keyframes cw-xp-up { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .cw-xp-float { animation-duration: 0.01s; } }

.cw-view { flex: 1; overflow: auto; border-radius: 16px; background: #3fa7d6; position: relative;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; box-shadow: inset 0 0 0 3px rgba(0,0,0,0.08); }
.cw-world { position: relative; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.cw-ground, .cw-ground-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }

.cw-district { position: absolute; z-index: 5; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.82);
  font-weight: 800; font-size: 0.95rem; color: #1f2937; pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

.cw-decor { position: absolute; font-size: 26px; width: 32px; text-align: center; pointer-events: none; z-index: 2; }

.cw-place { position: absolute; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.cw-place-art { flex: 1; display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 4px 2px rgba(0,0,0,0.25)); }
.cw-place-emoji { font-size: 54px; line-height: 1; }
.cw-place-art { position: relative; overflow: visible; }
.cw-place-img { height: var(--cw-h, 124px); width: var(--cw-h, 124px); max-width: none; image-rendering: pixelated; margin-bottom: -8px; }   /* CW_PLACE_SIZE: by what the place is (square art, so width = height; may spill past the footprint) */
.cw-decor-img { width: 36px; height: 36px; image-rendering: pixelated; }
.cw-place-name { margin-top: 2px; padding: 1px 8px; border-radius: 8px; background: rgba(255,255,255,0.9); color: #1f2937;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.cw-place.locked .cw-place-art { filter: grayscale(0.85) opacity(0.7); }
.cw-place.past .cw-place-art { filter: grayscale(0.4) opacity(0.8); }
.cw-flag, .cw-lock, .cw-sparkle { position: absolute; font-size: 22px; pointer-events: none; }
.cw-flag { top: 0; right: 2px; animation: cw-wave 1.6s ease-in-out infinite; transform-origin: bottom left; }
.cw-lock { top: 14px; left: 50%; transform: translateX(-50%); }
.cw-sparkle { top: -6px; left: 2px; animation: cw-sparkle 1.2s ease-in-out infinite; }
.cw-place.next .cw-place-name { background: #fde047; }
@keyframes cw-wave { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
/* The Trophy Hall while a badge is waiting to be seen. */
.cw-new-badge { position: absolute; top: -10px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: #e8443a; color: #fff;
  font: 900 18px/26px system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  pointer-events: none; animation: cw-new-bob 1s ease-in-out infinite; }
@keyframes cw-new-bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .cw-new-badge { animation: none; } }
@keyframes cw-sparkle { 0%,100% { transform: scale(0.8); opacity: 0.6; } 50% { transform: scale(1.25); opacity: 1; } }

.cw-target { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.9);
  opacity: 0; pointer-events: none; z-index: 4; transition: opacity 0.2s; }
.cw-target.on { opacity: 1; animation: cw-pulse 0.9s ease-in-out infinite; }
@keyframes cw-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } }

/* Pets: positioned by transform at their foot point (cell centre). */
.cw-pet, .cw-friend { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.cw-friend { pointer-events: auto; }
.cw-pet-body { position: absolute; left: -28px; bottom: -10px; width: 56px; height: 56px; display: flex; align-items: flex-end;
  justify-content: center; font-size: 40px; line-height: 1; }
.cw-friend .cw-pet-body { left: -22px; width: 44px; height: 44px; font-size: 32px; cursor: pointer; }
.cw-pet-body .pet-img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.cw-pet::before, .cw-friend::before { content: ""; position: absolute; left: -16px; top: 4px; width: 32px; height: 9px; border-radius: 50%;
  background: rgba(0,0,0,0.22); }
.cw-pet .cw-pet-body > * { display: block; }
/* No walk cycle yet: hop while moving. Real walk art replaces the hop. */
.cw-pet.walking:not(.has-walk-art) .cw-pet-body > * { animation: cw-hop 0.32s ease-in-out infinite; }
@keyframes cw-hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.cw-pet.walking:not(.swim)::after { content: ""; position: absolute; left: -6px; top: 2px; width: 12px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.55); animation: cw-dust 0.32s linear infinite; }
@keyframes cw-dust { from { transform: translateX(0) scale(0.6); opacity: 0.8; } to { transform: translateX(-10px) scale(1.4); opacity: 0; } }

/* In the water: sea pets swim (bob + bubbles); land pets sit in a boat. */
.cw-ride { position: absolute; left: -24px; top: -26px; width: 48px; text-align: center; font-size: 40px; line-height: 1; z-index: 1; }
.cw-pet .cw-pet-body { z-index: 0; }
.cw-pet.swim:not(.sea-pet) .cw-pet-body { bottom: -6px; }   /* standing in the boat: hull hides the legs */
.cw-ride-img { width: 100%; height: auto !important; max-height: none !important; image-rendering: pixelated; display: block; }
.cw-pet.boat .cw-ride { left: -32px; width: 64px; top: -30px; }
.cw-pet.bucket .cw-ride { left: -18px; width: 36px; top: -26px; }
.cw-pet.bucket .cw-pet-body { bottom: 10px; transform-origin: bottom; }
.cw-pet.swim::before, .cw-friend.swim::before { background: rgba(255,255,255,0.35); animation: cw-ripple 1.4s ease-out infinite; }
.cw-pet.swim.sea-pet .cw-pet-body > *, .cw-friend.swim .cw-pet-body > * { animation: cw-bob 1.6s ease-in-out infinite; }
.cw-pet.swim.sea-pet .cw-pet-body { clip-path: inset(0 0 18% 0); }
.cw-pet.swim.sea-pet.walking::after { content: "\00b0 \00b0"; position: absolute; left: -26px; top: -30px; color: #fff; font-size: 18px;
  animation: cw-bubbles 0.9s linear infinite; }
.cw-pet.swim:not(.sea-pet) .cw-ride { animation: cw-bob 1.6s ease-in-out infinite; }
@keyframes cw-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes cw-ripple { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes cw-bubbles { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-16px); opacity: 0; } }

/* Place / pet card */
.cw-card { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; width: min(420px, calc(100% - 32px));
  background: var(--color-surface, #fff); color: var(--color-text, #1f2937); border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: cw-pop 0.18s ease-out;
  max-height: calc(100% - 32px); overflow-y: auto; }
.cw-card[hidden] { display: none; }
@keyframes cw-pop { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.cw-card-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: inherit; }
.cw-card-head { display: flex; align-items: center; gap: 12px; padding-right: 56px; }
.cw-card-head h3 { margin: 0; font-size: 1.15rem; }
.cw-card-icon { font-size: 42px; line-height: 1; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.cw-card-pet .pet-img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.cw-card-line { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 2px; white-space: pre-line; }
.cw-card-btns { display: flex; gap: 10px; margin-top: 12px; }
.cw-btn { flex: 1; padding: 12px 14px; border: 0; border-radius: 12px; background: #3b82f6; color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; }
.cw-btn:disabled { background: #9ca3af; cursor: default; }
.cw-card-lock, .cw-card-done { margin: 12px 0 0; font-weight: 600; }

/* Entry banner on the dashboard / Word Adventure / Math Galaxy */
.cw-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #34d399, #3b82f6); color: #fff; box-shadow: 0 4px 14px rgba(59,130,246,0.3); }
.cw-banner-pet { width: 52px; height: 52px; font-size: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cw-banner-pet .pet-img { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; }
.cw-banner-text { flex: 1; display: flex; flex-direction: column; }
.cw-banner-text b { font-size: 1.1rem; }
.cw-banner-text span { opacity: 0.9; font-size: 0.9rem; }
.cw-banner-go { font-weight: 800; font-size: 1.05rem; }

/* Family bridge to Treasure Island: planks fill in from the beach outwards. */
.cw-bridge { position: absolute; z-index: 3; width: 24px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 2px 0; border-left: 2px solid rgba(120,72,30,0.55); border-right: 2px solid rgba(120,72,30,0.55); cursor: pointer; }
.cw-plank { display: block; height: 6px; margin: 0 -4px; border-radius: 2px; border: 1px dashed rgba(255,255,255,0.75); }
.cw-plank.on { background: #a0662b; border: 1px solid #6b4019; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); }
.cw-bridge.done { filter: drop-shadow(0 0 4px rgba(253,224,71,0.9)); }

/* Siblings' pets, waiting where they last played */
.cw-visitor { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.cw-visitor .cw-pet-body { left: -22px; width: 44px; height: 44px; font-size: 32px; cursor: pointer; }
.cw-visitor::before { content: ""; position: absolute; left: -14px; top: 4px; width: 28px; height: 8px; border-radius: 50%; background: rgba(0,0,0,0.2); }
.cw-visitor-name { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); padding: 0 6px; border-radius: 8px;
  background: #a78bfa; color: #fff; font-size: 0.68rem; font-weight: 800; white-space: nowrap; pointer-events: none; }
.cw-card-list { margin: 10px 0 0; padding-left: 20px; }

/* The pet following the explorer: a little smaller, a step behind */
.cw-pal .cw-pet-body { left: -22px; width: 44px; height: 44px; font-size: 32px; }
/* ...and as big as it has grown: a grown-up pet stands about as tall as the explorer */
.cw-pal[data-stage="teen"] .cw-pet-body { left: -25px; width: 50px; height: 50px; }
.cw-pal[data-stage="adult"] .cw-pet-body { left: -29px; width: 58px; height: 58px; }
.cw-pal[data-stage="legendary"] .cw-pet-body { left: -32px; width: 64px; height: 64px; }
/* Big animals (CW_BIG_PETS): a grown panda towers over the explorer */
.cw-pal.big-pet:not(.in-boat)[data-stage="baby"] .cw-pet-body { left: -28px; width: 56px; height: 56px; }
.cw-pal.big-pet:not(.in-boat)[data-stage="teen"] .cw-pet-body { left: -36px; width: 72px; height: 72px; }
.cw-pal.big-pet:not(.in-boat)[data-stage="adult"] .cw-pet-body { left: -44px; width: 88px; height: 88px; }
.cw-pal.big-pet:not(.in-boat)[data-stage="legendary"] .cw-pet-body { left: -50px; width: 100px; height: 100px; }
.cw-pal.boat .cw-ride { left: -24px; width: 48px; top: -24px; }
/* Explorer and land pet share one boat: a longer hull, the pet in the stern */
.cw-pet.boat.boat-shared .cw-ride { left: -60px; width: 104px; top: -40px; }
.cw-pet.boat.boat-shared.face-left .cw-ride { left: -44px; }
.cw-pal.in-boat .cw-pet-body { bottom: -16px; }   /* feet on the deck, inside the hull */
.cw-pal.in-boat::before { display: none; }          /* no ground shadow on deck */
/* Flyers: up off the ground with a slow hover; the shadow stays below */
.cw-pet.flying .cw-pet-body { bottom: 26px; }
.cw-pet.flying .cw-pet-body > * { animation: cw-hover 1.8s ease-in-out infinite; }
.cw-pet.flying::before { transform: scale(0.75); opacity: 0.7; }
@keyframes cw-hover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.cw-visitor .cw-visitor-pal { left: -46px; width: 34px; height: 34px; font-size: 24px; }
.cw-banner-pet { position: relative; }
.cw-banner-pet .cw-banner-pal { position: absolute; right: -14px; bottom: -4px; width: 30px; height: 30px; display: flex; align-items: flex-end; justify-content: center; font-size: 22px; }
.cw-banner-pal .pet-img { width: 30px; height: 30px; }

/* Profile: pick your explorer */
.cw-picker { margin: 0 0 var(--space-4, 16px); padding: 16px; border-radius: 16px; background: var(--color-primary-surface, #f5f3ff); border: 1px solid var(--color-border, #e5e7eb); }
.cw-picker h3 { margin: 0; font-size: 1.1rem; }
.cw-picker p { margin: 2px 0 12px; color: var(--color-text-muted); font-size: 0.9rem; }
.cw-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.cw-picker-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; background: var(--color-surface, #fff); color: inherit; font-weight: 700; font-size: 0.8rem; }
.cw-picker-item img { height: 72px; width: auto; image-rendering: pixelated; }
.cw-picker-item.selected { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.cw-adopt { position: absolute; z-index: 40; top: 58px; right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: #f59e0b; color: #fff; font-weight: 800; font-size: 0.9rem; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }

/* The kid's picture across the app: their explorer's head and shoulders
   (kidPictureHTML in app.js), cropped to the round avatar frames. */
.kid-explorer-pic { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; image-rendering: pixelated;
  transform: scale(1.12); transform-origin: 50% 0; }
.kid-dash-avatar, .avatar-circle, .kid-picker-avatar, .kid-ready-avatar, .mobile-kid-btn { overflow: hidden; }
.kid-dash-face, .mobile-kid-face { display: block; width: 100%; height: 100%; }
.kid-explorer-pic.kid-pic-chip { display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  background: rgba(0,0,0,0.06); transform: none; }

.kid-pic-wrap { position: relative; display: block; width: 100%; height: 100%; }
.kid-pic-hat { position: absolute; transform: translate(-50%, -100%); height: auto; image-rendering: pixelated; pointer-events: none; }
.shop-hat-img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; display: block; }

/* First-time "Choose your explorer" prompt */
.cw-prompt { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15,23,42,0.55); }
.cw-prompt-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-radius: 20px;
  background: var(--color-surface, #fff); color: var(--color-text, #1f2937); box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.cw-prompt-card h2 { margin: 0 0 4px; font-size: 1.35rem; }
.cw-prompt-card p { margin: 0 0 14px; color: var(--color-text-muted); font-size: 0.92rem; }
.cw-prompt-card .cw-picker-grid { grid-template-columns: repeat(3, 1fr); }

/* Zoom: the sizer sets the scroll range, the world scales inside it */
.cw-zoom { position: relative; }
.cw-zoom .cw-world { transform-origin: 0 0; }
.cw-view { touch-action: pan-x pan-y; }
.cw-zoom-btns { position: absolute; right: 14px; bottom: 18px; z-index: 45; display: flex; flex-direction: column; gap: 6px; }
.cw-zoom-btns button { width: 42px; height: 42px; border: 0; border-radius: 12px; cursor: pointer; font-size: 1.4rem; font-weight: 800;
  background: rgba(255,255,255,0.92); color: #1f2937; box-shadow: 0 3px 10px rgba(0,0,0,0.25); }
/* The plank bridge out to the Story Shipwreck: a solid walkway with rope rails. */
.cw-ship-bridge { pointer-events: none; width: 26px; margin-left: -1px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.35));
  background: repeating-linear-gradient(180deg, #b0773a 0 8px, #6b4019 8px 10px);
  border-left: 3px solid #d9b178; border-right: 3px solid #d9b178; border-radius: 3px; }
.cw-ship-bridge .cw-plank { display: none; }
/* Sitting IN the rowboat: hull behind the explorer, its front rim in front,
   the explorer lowered into the boat (cwPlaceActor draws both boat layers). */
.cw-pet.boat > .cw-ride { z-index: auto; }
.cw-pet.boat .cw-ride-back { position: relative; z-index: 0; }
.cw-pet.boat .cw-ride-front { position: absolute; left: 0; top: 0; z-index: 2; clip-path: inset(56% 0 0 0); }
.cw-pet.boat:not(.sea-pet) > .cw-pet-body { z-index: 1; bottom: -14px; transform-origin: 50% 100%; }
.cw-pet.boat:not(.sea-pet) > .cw-pet-body > * { transform: scale(0.86); transform-origin: 50% 100%; }

/* ---- The Daily Fountain: a wishing fountain card (cwShowFountainCard). */
.cw-card.cw-card-fountain { background: linear-gradient(180deg, #e8f6ff 0%, #cfeaf9 55%, #9fd3ee 100%); color: #12324a;
  border: 4px solid #c9d3dc; box-shadow: inset 0 0 0 3px #f6fbff, 0 10px 30px rgba(0, 0, 0, 0.3); }
.cwf { text-align: center; }
.cwf h3 { margin: 2px 0 2px; font-size: 1.25rem; }
.cwf .cw-card-line { color: #2c5470; }
.cwf-top { position: relative; width: 96px; height: 96px; margin: -4px auto 0; }
.cwf-top .cwf-art { width: 96px; height: 96px !important; image-rendering: pixelated; }
.cwf-top i { position: absolute; width: 5px; height: 5px; background: #fff; border-radius: 50%; box-shadow: 0 0 6px 2px rgba(160, 220, 255, 0.9);
  animation: cw-twinkle 1.8s ease-in-out infinite; opacity: 0; }
.cwf-top i:nth-child(2) { left: 30%; top: 22%; } .cwf-top i:nth-child(3) { left: 62%; top: 30%; animation-delay: 0.5s; }
.cwf-top i:nth-child(4) { left: 46%; top: 12%; animation-delay: 1s; } .cwf-top i:nth-child(5) { left: 70%; top: 55%; animation-delay: 1.3s; }
@keyframes cw-twinkle { 50% { opacity: 1; transform: scale(1.2); } }
.cwf-pool { display: flex; justify-content: center; gap: 26px; margin: 10px auto 2px; padding: 10px 18px 6px; width: fit-content; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #6cc4ee 0%, #3a9fd4 60%, #2a7fb4 100%); box-shadow: inset 0 3px 8px rgba(0, 40, 80, 0.45), 0 0 0 5px #dfe6ec, 0 0 0 7px #b8c2cc; }
.cwf-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cwf-slot small { font-size: 11px; font-weight: 800; color: #eaf7ff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.cwf-coin { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.7); }
.cwf-coin img { width: 28px; height: 28px; image-rendering: pixelated; opacity: 0; }
.cwf-slot.in .cwf-coin { border-color: transparent; }
.cwf-slot.in .cwf-coin img { opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 236, 140, 0.95)); animation: cwf-shine 2.4s ease-in-out infinite; }
@keyframes cwf-shine { 50% { filter: drop-shadow(0 0 12px rgba(255, 246, 190, 1)) brightness(1.15); } }
.cwf-toss .cwf-slot.in .cwf-coin img { animation: cwf-arc 1s cubic-bezier(.3, .7, .4, 1) both, cwf-shine 2.4s 1s ease-in-out infinite; }
.cwf-toss .cwf-slot:nth-child(2).in .cwf-coin img { animation-delay: 0.25s, 1.25s; }
@keyframes cwf-arc { 0% { transform: translate(0, 90px) rotate(0) scale(1.3); opacity: 0; } 20% { opacity: 1; }
  55% { transform: translate(0, -50px) rotate(360deg) scale(1.1); } 100% { transform: translate(0, 0) rotate(720deg) scale(1); opacity: 1; } }
.cwf-toss .cwf-pool { animation: cwf-splash 0.6s 0.9s ease-out; }
@keyframes cwf-splash { 40% { box-shadow: inset 0 3px 8px rgba(0, 40, 80, 0.45), 0 0 0 5px #dfe6ec, 0 0 0 7px #b8c2cc, 0 -6px 24px 10px rgba(180, 230, 255, 0.9); } }
.cw-card .cw-btn.cwf-btn { background: #3a9fd4; color: #fff; border: 10px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 10px;
  border-image: url("./world/inside/fountain/btn-px.png") 10 / 10px stretch; background-clip: padding-box; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.cw-card .cw-btn.cwf-btn.done { filter: saturate(0.6); opacity: 0.85; }
/* On the map: once both coins are in, the fountain sparkles. */
.cw-place[data-place="fountain"].done .cw-place-art { animation: cwi-restored-glow 2.6s ease-in-out infinite; }
.cw-card .cwf-ico { display: inline-block !important; width: 18px !important; height: 18px !important; margin: 0 4px 0 0; image-rendering: pixelated; vertical-align: -3px; }

/* Profile: hair colour + skin tone swatches under the hair styles */
.cw-look-row + .cw-look-row { margin-top: 14px; }
.cw-look-row h4 { margin: 0 0 8px; font-size: 0.95rem; }
.cw-picker p.cw-look-note { margin: -4px 0 8px; font-size: 0.82rem; }
.cw-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px 4px; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; background: var(--color-surface, #fff); color: inherit; font-weight: 700; font-size: 0.75rem; }
.cw-swatch-dot { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); }
.cw-swatch.as-drawn .cw-swatch-dot { background: repeating-linear-gradient(45deg, #e5e7eb 0 5px, #f9fafb 5px 10px); }
.cw-swatch.selected { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }

/* ---- Pixel icons in place of emoji (cwIconize): sized to the text around them. */
.cw-ico { display: inline-block; height: 1.2em; width: auto; vertical-align: -0.25em; image-rendering: pixelated; }
.cw-flag .cw-ico, .cw-lock .cw-ico, .cw-sparkle .cw-ico { height: 26px; }
.cw-card-x .cw-ico, .cw-card-say .cw-ico { height: 22px; vertical-align: middle; }
.cw-district .cw-ico { height: 1.35em; margin-right: 2px; }

/* ---- Adventure Camp: the card is the camp — warm canvas, the tent and a
   flickering campfire on top, log buttons (PixelLab: world/icons/camp-btn). */
.cw-card.cw-card-camp { background: linear-gradient(180deg, #fbefd2 0%, #f1dcae 60%, #e2c48a 100%); color: #4a2f17;
  border: 4px solid #8a5a2b; box-shadow: inset 0 0 0 3px #fff6df, 0 10px 30px rgba(0, 0, 0, 0.3); }
.cw-card-camp .cwc-top { position: relative; width: 132px; height: 96px; margin: -4px auto 0; }
.cw-card-camp .cwc-art { width: 96px !important; height: 96px !important; image-rendering: pixelated; }
.cw-card-camp .cwc-fire { position: absolute; right: 0; bottom: 4px; width: 40px !important; height: 40px !important; image-rendering: pixelated;
  animation: cwc-flicker 0.9s steps(2) infinite; transform-origin: 50% 100%; }
@keyframes cwc-flicker { 50% { transform: scaleY(1.08); filter: brightness(1.15) drop-shadow(0 0 6px rgba(255, 170, 60, 0.9)); } }
.cw-card-camp .cwc-title { text-align: center; margin: 2px 0; font-size: 1.25rem; }
.cw-card-camp .cwc-line, .cw-card-camp .adv-empty, .cw-card-camp p { color: #6a4423; text-align: center; }
.cw-card-camp .adv-h { color: #5a3518; }
.cw-card .cw-btn.cwc-btn, .cw-card-camp .cw-btn { background: #a0632e; color: #fff8e6; border: 10px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url("./world/icons/camp-btn-px.png") 10 12 fill / 10px 12px stretch; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); image-rendering: pixelated; }

/* ---- Treasure Island: the card is the island — sand and sea, the chest on
   top (open once the bridge is built), the week's bridge as PixelLab planks. */
.cw-card.cw-card-treasure { background: linear-gradient(180deg, #fff3cf 0%, #f6dc98 55%, #7fd3d6 100%); color: #3f2a12;
  border: 4px solid #b8893c; box-shadow: inset 0 0 0 3px #fff8e2, 0 10px 30px rgba(0, 0, 0, 0.3); }
.cwt { text-align: center; }
.cwt h3 { margin: 2px 0; font-size: 1.25rem; }
.cwt .cw-card-line, .cwt p { color: #5a3d16; }
.cwt-top { width: 104px; height: 104px; margin: -4px auto 0; }
.cwt-top .cwt-art { width: 104px !important; height: 104px !important; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.2)); }
.cwt-bridge { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 10px auto 4px; padding: 6px 10px; width: fit-content;
  background: rgba(63, 160, 190, 0.35); border-radius: 10px; }
.cwt-plank { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 2px dashed rgba(90, 61, 22, 0.35); }
.cwt-plank img { width: 26px; height: 26px; image-rendering: pixelated; opacity: 0.18; filter: grayscale(1); }
.cwt-plank.in { border-color: transparent; }
.cwt-plank.in img { opacity: 1; filter: none; }
.cwt .cw-card-list { list-style: none; padding: 0; margin: 4px 0; display: flex; justify-content: center; gap: 14px; font-weight: 700; }
.cw-card .cw-btn.cwt-btn { background: #e8cf95; color: #4a2f10; border: 9px solid transparent; border-radius: 0; box-shadow: none;
  border-image: url("./world/icons/treasure-btn-px.png") 9 fill / 9px stretch; image-rendering: pixelated; }

/* Today's Plan = the village notice board: an oak frame (PixelLab UI panel)
   round a cork board, a sign for the title, and the day's tasks as tilted
   parchment notes, each pinned with a tack and sealed in wax once done. */
.cw-card.cw-card-plan { background: #c99a62 radial-gradient(rgba(120, 72, 30, 0.22) 1px, transparent 1.5px) 0 0 / 7px 7px; color: #3f2711;
  border: 26px solid transparent; border-image: url("./world/icons/plan-frame-px.png") 52 fill / 26px stretch; border-radius: 0; padding: 4px 6px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.cw-card-plan .cw-card-x, .cw-card-plan .cw-card-say { top: 2px; color: #3f2711; }
.cw-card-plan .cw-card-x { right: 4px; }
.cwp-sign { width: 220px; max-width: 80%; margin: 0 auto; padding: 14px 10px 12px; background: url("./world/icons/sign-px.png") center / 100% 100% no-repeat; image-rendering: pixelated; text-align: center; }
.cwp-sign h3 { margin: 0; font-size: 1.15rem; color: #fff3d6; text-shadow: 0 2px 0 #4a2a10; }
.cw-card-plan .cwp-line { text-align: center; color: #4a2c12; font-weight: 700; margin: 6px 0 2px; }
.cwp-cork { display: flex; flex-direction: column; gap: 18px; padding: 12px 4px 4px; }
.cwp-note { position: relative; transform: rotate(var(--tilt, 0deg)); background: linear-gradient(180deg, #fbf0cf, #f0dcaa); border: 2px solid #b68b4c;
  border-radius: 3px 3px 12px 3px; padding: 18px 12px 10px; box-shadow: 2px 4px 0 rgba(70, 40, 10, 0.3); cursor: pointer; transition: transform 0.12s; }
.cwp-note:active { transform: rotate(0deg) scale(0.98); }
.cwp-note.done { cursor: default; filter: saturate(0.75); padding-right: 60px; }
.cwp-note.done .cwp-body { opacity: 0.6; }
.cwp-pin { position: absolute; top: -12px; left: 50%; width: 18px; height: 24px; margin-left: -9px; image-rendering: pixelated; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.3)); }
.cwp-tag { position: absolute; top: -9px; left: 10px; display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 4px; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; color: #fff; background: #8a5a2b; }
.cwp-tag img { width: 16px; height: 16px; object-fit: contain; image-rendering: pixelated; }
.cwp-note.k-review .cwp-tag { background: #b4507a; }
.cwp-note.k-new .cwp-tag { background: #c8921a; }
.cwp-note.k-game .cwp-tag { background: #3f6fb5; }
.cwp-body { display: flex; align-items: center; gap: 10px; }
.cwp-ico { font-size: 28px; width: 36px; flex-shrink: 0; text-align: center; }
.cwp-ico .cw-ico { width: 32px; height: 32px; }
.cwp-body b { display: block; font-size: 0.98rem; line-height: 1.2; }
.cwp-body small { display: block; color: #6b4a22; font-size: 0.82rem; margin-top: 2px; }
.cwp-seal { position: absolute; right: 8px; top: 50%; width: 46px; height: 46px; margin-top: -23px; image-rendering: pixelated; transform: rotate(-12deg);
  animation: cwp-stamp 0.35s ease-out; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.25)); }
@keyframes cwp-stamp { from { transform: rotate(-12deg) scale(1.8); opacity: 0; } }
.cwp-swap { position: absolute; right: 6px; bottom: -10px; display: flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border: 2px solid #6b4a22;
  border-radius: 10px; background: #fbf0cf; color: #4a2c12; font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.cwp-swap img { width: 16px; height: 16px; image-rendering: pixelated; }
.cwp-track { display: flex; justify-content: center; gap: 6px; margin: 14px auto 0; padding: 5px 10px; width: fit-content; background: rgba(74, 44, 18, 0.25); border-radius: 10px; }
.cwp-star { width: 22px; height: 22px; image-rendering: pixelated; opacity: 0.25; filter: grayscale(1); }
.cwp-star.on { opacity: 1; filter: none; }
.cwp-win { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cwp-win img { width: 40px; height: 40px; image-rendering: pixelated; animation: cwp-bob 1.2s ease-in-out infinite; }
.cwp-win .cw-card-done { margin: 8px 0 0; color: #3f2711; }
@keyframes cwp-bob { 50% { transform: translateY(-4px); } }

/* Door guardians waiting outside their place (renderCuriousWorld, .cw-guard). */
.cw-guard { position: absolute; width: 64px; height: 64px; z-index: 7; cursor: pointer; pointer-events: auto; }
.cw-guard-hop { display: block; width: 100%; height: 100%; animation: cw-guard-bob 1.6s ease-in-out infinite; }
.cw-guard img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; image-rendering: pixelated; transform: scaleX(-1);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }
/* Roaming the front entrance: cwGuardAnim writes each one's keyframes (the
   walk, and which way it faces); the hop quickens while it walks. */
.cw-guard.roam { animation-timing-function: linear; animation-iteration-count: infinite; }
.cw-guard.roam img { animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
.cw-guard.roam .cw-guard-hop { animation-duration: 0.9s; }
/* With a real walk cycle the hop stops (the frames do the walking); the walk
   frames sit on the standing ones and take turns with them (-gait/-stand). */
.cw-guard-hop { position: relative; }
.cw-guard img.cw-guard-walk { position: absolute; left: 0; top: 0; opacity: 0; }
.cw-guard.walks .cw-guard-hop { animation: none; }
@media (prefers-reduced-motion: reduce) { .cw-guard.roam, .cw-guard.roam img, .cw-guard-hop { animation: none !important; } .cw-guard img.cw-guard-walk { display: none; } }
.cw-guard::after { content: ""; position: absolute; left: 50%; top: -8px; width: 14px; height: 14px; margin-left: -7px;
  background: url("./world/icons/shield-px.png") center / contain no-repeat; image-rendering: pixelated; animation: cw-guard-bob 1.6s ease-in-out infinite reverse; }
@keyframes cw-guard-bob { 50% { transform: translateY(-3px); } }
.cw-guard::after { animation: none; }

/* Pet treats (cwSnacksHTML / cwShowTreatCard / cwPlayEat). */
.cw-snack { position: absolute; width: 32px; height: 32px; z-index: 6; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cw-snack img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); animation: cw-snack-bob 1.8s ease-in-out infinite; }
.cw-snack::after { content: ""; position: absolute; right: -2px; top: -4px; width: 14px; height: 14px; background: url("./world/icons/sparkle-px.png") center / contain no-repeat;
  image-rendering: pixelated; animation: cw-snack-twinkle 1.2s steps(2) infinite; }
@keyframes cw-snack-bob { 50% { transform: translateY(-4px); } }
@keyframes cw-snack-twinkle { 50% { opacity: 0.2; } }

.cw-treat-btn { position: absolute; left: 14px; bottom: 18px; z-index: 45; width: 58px; height: 58px; border-radius: 16px; border: 3px solid #5a3410;
  background: #f6e7c4; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); cursor: pointer; padding: 4px; }
.cw-treat-btn img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.cw-treat-left { position: absolute; right: -8px; top: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: #3f8f3a;
  color: #fff; font-size: 0.8rem; font-weight: 800; line-height: 22px; border: 2px solid #fff; }

.cw-eat { position: absolute; left: 50%; bottom: 60%; width: 0; height: 0; pointer-events: none; z-index: 30; }
.cw-eat-food { position: absolute; left: -14px; top: -60px; width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; animation: cw-eat-drop 1s ease-in forwards; }
@keyframes cw-eat-drop { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: 1; } 55% { transform: translateY(48px) scale(1); }
  70% { transform: translateY(50px) scale(0.7) rotate(-12deg); } 85% { transform: translateY(52px) scale(0.4) rotate(10deg); } 100% { transform: translateY(54px) scale(0); opacity: 0; } }
.cw-eat-heart { position: absolute; left: -9px; top: -10px; width: 18px; height: 18px; image-rendering: pixelated; opacity: 0; animation: cw-eat-heart 1.1s ease-out forwards; }
.cw-eat-heart.h1 { animation-delay: 0.7s; --hx: -18px; }
.cw-eat-heart.h2 { animation-delay: 0.85s; --hx: 4px; }
.cw-eat-heart.h3 { animation-delay: 1s; --hx: 22px; }
@keyframes cw-eat-heart { 0% { opacity: 0; transform: translate(0, 0) scale(0.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--hx), -46px) scale(1.1); } }
.cw-munch .cw-pet-body { animation: cw-munch 0.25s ease-in-out 3 0.65s; }
@keyframes cw-munch { 50% { transform: scaleY(0.9) translateY(2px); } }

.cw-card.cw-card-treats { background: linear-gradient(180deg, #fbefd2, #f1dcae); color: #4a2f17; border: 3px solid #5a3410; }
.cwtr-head { display: flex; align-items: center; gap: 12px; padding-right: 56px; }
.cwtr-head > img { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; }
.cwtr-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.cwtr-hap { display: flex; align-items: center; gap: 6px; }
.cwtr-hap img { width: 18px; height: 18px; image-rendering: pixelated; }
.cwtr-bar { flex: 1; width: 120px; height: 10px; border-radius: 999px; background: #e2c48a; border: 2px solid #8a5a2b; overflow: hidden; }
.cwtr-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f06292, #ff8a80); }
.cwtr-tip { margin: 10px 0 0; font-size: 0.88rem; color: #6a4423; }
.cwtr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cwtr-food { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid #8a5a2b; border-radius: 12px; background: #fff8e6;
  color: #4a2f17; font: inherit; cursor: pointer; box-shadow: 0 3px 0 rgba(90, 52, 16, 0.35); }
.cwtr-food img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.cwtr-food b { font-size: 0.8rem; line-height: 1.1; text-align: center; }
.cwtr-food small { font-size: 0.72rem; color: #b0436a; font-weight: 700; }
.cwtr-cost { font-size: 0.72rem; font-weight: 800; color: #8a5a2b; }
.cwtr-cost.free { color: #2f7a2a; }
.cwtr-food.off { opacity: 0.45; cursor: default; }
.cwtr-food:not(.off):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(90, 52, 16, 0.35); }
