/* ======== Curious World — inside the places ========
   Rooms from curious-inside.js; art from tools/build_inside.py (world/inside/). */

/* ---- The map's place cards: pixel buttons instead of a flat web button.
   Every place gets a carved-wood button; places with an inside get their own
   world's PixelLab frame (9-slice border-image, label stays real text). */
.cw-screen .cw-btn {
  background: linear-gradient(#a8743f, #8a5a2b); color: #fff8e6;
  border: 3px solid #4a2f17; border-radius: 6px;
  box-shadow: inset 0 2px 0 rgba(255, 236, 190, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 3px 0 #2e1c0d;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); letter-spacing: 0.02em;
  image-rendering: pixelated;
}
.cw-screen .cw-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 236, 190, 0.35), 0 1px 0 #2e1c0d; }
.cw-screen .cw-btn:disabled { filter: grayscale(0.7); opacity: 0.6; }
.cw-card-icon .cw-card-place { width: 56px; height: 56px !important; object-fit: contain; image-rendering: pixelated; }

.cw-btn.cwi-go, .cw-btn.cwi-btn { color: #fff; padding: 8px 14px; font-size: 1.05rem; }
/* The frame itself comes inline from cwiBtnStyle (its own 9-slice). */
.cw-btn.cwi-go, .cw-btn.cwi-btn { image-rendering: pixelated; }

/* ---- The room */
.cwi-screen { --cwi-tint: #6b5bd6; }
.cwi-screen .cw-top h1 { color: var(--cwi-tint); }
.cwi-board { background: #1b1430; overflow: hidden; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.cwi-ground { position: absolute; left: 0; top: 0; width: 512px; height: 384px; image-rendering: pixelated; pointer-events: none; }
.cwi-prop, .cwi-station img { image-rendering: pixelated; pointer-events: none; }
.cwi-prop { position: absolute; transform: translate(-50%, -100%); max-width: 60px; max-height: 60px; }
.cwi-exit { max-width: 64px; max-height: 64px; transform: translate(-50%, -82%); }
.cwi-station { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.cwi-station img { max-width: 60px; max-height: 60px; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.55)); }
.cwi-tag { order: -1; margin-bottom: 1px; padding: 1px 6px; border-radius: 8px; background: rgba(20, 14, 40, 0.78); color: #fff;
  font-size: 11px; font-weight: 800; white-space: nowrap; line-height: 1.5; }
.cwi-screen-prop img { animation: cwi-glow 2.4s ease-in-out infinite; }
@keyframes cwi-glow { 50% { filter: drop-shadow(0 0 12px rgba(160, 220, 255, 0.95)); } }

/* ---- Monsters (Pet Battle sprites) */
.cwi-mon { position: absolute; transform: translate(-50%, -96%); width: 52px; height: 52px; display: flex; align-items: flex-end; justify-content: center; }
.cwi-mon.boss { width: 64px; height: 64px; }
.cwi-mon-img { max-width: 100%; max-height: 100%; image-rendering: pixelated; pointer-events: none; transition: transform 0.15s; }
.cwi-mon.moving:not(.has-walk) .cwi-mon-img { animation: cwi-hop 0.36s ease-in-out infinite; }
.cwi-mon-walk { position: absolute; bottom: 0; left: 50%; margin-left: -50%; width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  image-rendering: pixelated; pointer-events: none; opacity: 0; }
.cwi-mon.has-walk.moving .cwi-mon-walk { opacity: 1; }
.cwi-mon.has-walk.moving .cwi-mon-img { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .cwi-mon-walk { display: none; } .cwi-mon.has-walk.moving .cwi-mon-img { opacity: 1; } }
@keyframes cwi-hop { 50% { translate: 0 -3px; } }
.cwi-mon-badge { position: absolute; top: -10px; right: -8px; font-size: 13px; font-weight: 900; color: #1f2937; line-height: 18px; }
.cwi-mon-badge .px-fallback { background: #fff; border-radius: 10px; padding: 0 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.cwi-mon-badge .cwi-badge-img { width: 22px; height: 22px !important; image-rendering: pixelated; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.cwi-mon-cleared .cwi-mon-img { filter: saturate(0.6) brightness(0.9); }
.cwi-mon-cleared .cwi-mon-badge .px-fallback { background: #22c55e; color: #fff; }
.cwi-mon-next .cwi-mon-img { filter: drop-shadow(0 0 6px rgba(255, 214, 80, 0.95)); }
.cwi-mon-locked .cwi-mon-img { filter: grayscale(0.5) brightness(0.75); animation: cwi-sleep 3s ease-in-out infinite; }
@keyframes cwi-sleep { 50% { transform: scale(1.04, 0.97); } }
.cwi-card-mon img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }

/* ---- Underwater: light from above and rising bubbles */
.cwi-underwater::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 900;
  background: linear-gradient(180deg, rgba(170, 230, 255, 0.18), rgba(10, 40, 80, 0.12) 70%),
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.05) 0 18px, transparent 18px 60px); }
.cwi-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 901; overflow: hidden; }
.cwi-bubbles i { position: absolute; bottom: -12px; width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid rgba(220, 245, 255, 0.85); background: rgba(255, 255, 255, 0.15); animation: cwi-rise 7s linear infinite; }
.cwi-bubbles i:nth-child(1) { left: 9%; animation-delay: 0s; }
.cwi-bubbles i:nth-child(2) { left: 27%; animation-delay: 2.4s; width: 6px; height: 6px; }
.cwi-bubbles i:nth-child(3) { left: 46%; animation-delay: 4.1s; }
.cwi-bubbles i:nth-child(4) { left: 63%; animation-delay: 1.2s; width: 10px; height: 10px; }
.cwi-bubbles i:nth-child(5) { left: 80%; animation-delay: 5.3s; width: 6px; height: 6px; }
.cwi-bubbles i:nth-child(6) { left: 92%; animation-delay: 3.2s; }
@keyframes cwi-rise { from { transform: translate(0, 0); opacity: 0.9; } 50% { transform: translate(6px, -200px); } to { transform: translate(-4px, -400px); opacity: 0; } }

/* ---- Lesson screen card */
.cwi-lessons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cwi-lesson { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff); color: inherit; font-weight: 700; cursor: pointer; }
.cwi-lesson small { display: block; font-weight: 600; color: var(--color-text-muted); font-size: 0.8rem; }
.cwi-lesson.first { border-color: #f5b301; box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.25); }
.cwi-lesson.done { opacity: 0.7; }
.cwi-lesson-play { width: 34px; height: 34px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--cwi-tint, #6b5bd6); color: #fff; font-size: 0.9rem; }

/* ---- A fight started inside a world: its backdrop behind the fighters,
   fading into the page so the question card and scratch pad stay on a plain panel. */
.pb-arena.pb-in-world { position: relative; isolation: isolate; padding: 10px 10px 0; }
.pb-arena.pb-in-world::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 9; z-index: -1;
  background: var(--pb-arena-bg) center top / cover no-repeat; image-rendering: pixelated; border-radius: 16px 16px 0 0;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
}
.pb-in-world .pb-monster .pb-fighter-name, .pb-in-world .pb-arena-top { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.6); }
.pb-in-world .pb-qcard { position: relative; z-index: 2; }

/* The room can be taller than the phone: keep its cards on screen. */
.cwi-screen .cw-card { z-index: 2000; position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 70vh; }

/* ---- Rooms light up (cwiProgress): --cwi-p runs 0 (dark, drained) to 1 (restored). */
.cwi-board .cwi-ground { filter: saturate(calc(0.3 + 0.7 * var(--cwi-p, 1))) brightness(calc(0.62 + 0.38 * var(--cwi-p, 1))); transition: filter 1.2s; }
.cwi-dark { position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at 50% 60%, transparent 35%, rgba(8, 6, 24, 0.75));
  opacity: calc(0.85 * (1 - var(--cwi-p, 1))); transition: opacity 1.2s; }
.cwi-prop.dim { filter: grayscale(0.85) brightness(0.62); }
.cwi-prop.lit { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cwi-tint) 55%, #fff)); }
.cwi-prop.just-lit { animation: cwi-lightup 0.9s ease-out both; }
@keyframes cwi-lightup {
  0% { filter: grayscale(0.85) brightness(0.62); transform: translate(-50%, -100%) scale(1); }
  45% { filter: brightness(1.9) drop-shadow(0 0 14px #fff6c2); transform: translate(-50%, -100%) scale(1.22); }
  100% { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cwi-tint) 55%, #fff)); transform: translate(-50%, -100%) scale(1); }
}
.cwi-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 899; }
.cwi-sparkles i { position: absolute; width: 4px; height: 4px; background: #fff7c8; box-shadow: 0 0 6px 2px rgba(255, 236, 150, 0.8);
  animation: cwi-twinkle 3s ease-in-out infinite; opacity: 0; }
@keyframes cwi-twinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 0.95; transform: scale(1); } }
.cwi-restored { box-shadow: 0 0 0 3px #f5c542, 0 0 26px rgba(245, 197, 66, 0.75), 0 6px 24px rgba(0, 0, 0, 0.35); }
.cwi-lights { font-weight: 800; font-size: 0.9rem; padding: 3px 10px; border-radius: 12px; white-space: nowrap;
  background: color-mix(in srgb, var(--cwi-tint) 18%, transparent); color: var(--cwi-tint); }
.cwi-lights.restored { background: #f5c542; color: #4a3200; }

/* On the big map: a restored place glows gold. */
.cw-place.restored .cw-place-art { animation: cwi-restored-glow 2.6s ease-in-out infinite; }
@keyframes cwi-restored-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(245, 197, 66, 0.7)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 214, 90, 1)); }
}

/* ---- Game feel (2026-11-21): monster alerts, swirl into battle, the "what
   next" trail, pet bubbles + daily treat, Inkwell's hint, sound, guide. */
.cwi-mon.alert::after { content: "!"; position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: #ffd43b; color: #7a3d00;
  font-weight: 900; font-size: 15px; box-shadow: 0 2px 0 #b8860b; animation: cwi-alert 1.4s ease-out both; }
.cwi-mon.alert .cwi-mon-img { animation: cwi-jump 0.45s ease-out 2; }
@keyframes cwi-alert { 0% { transform: translate(-50%, 8px) scale(0.3); opacity: 0; } 15% { transform: translate(-50%, -4px) scale(1.2); opacity: 1; } 30%, 85% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes cwi-jump { 50% { translate: 0 -10px; } }
.cwi-swirl { position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--cwi-tint, #6b5bd6) 0 15deg, #11101a 15deg 30deg);
  animation: cwi-swirl 1.3s ease-in-out forwards; }
@keyframes cwi-swirl {
  0% { clip-path: circle(0% at 50% 50%); transform: rotate(0deg); }
  45%, 60% { clip-path: circle(80% at 50% 50%); transform: rotate(180deg); }
  100% { clip-path: circle(80% at 50% 50%); transform: rotate(260deg); opacity: 0; }
}
#cwi-trail { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#cwi-trail i { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: #fff6b0; box-shadow: 0 0 6px 2px rgba(255, 230, 120, 0.85); animation: cwi-dot 1.6s ease-in-out infinite; }
@keyframes cwi-dot { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
.cwi-arrow { position: absolute; transform: translateX(-50%); z-index: 950; color: #ffd43b; font-size: 22px;
  text-shadow: 0 2px 0 #7a3d00, 0 0 8px rgba(255, 212, 59, 0.9); animation: cwi-bob 0.9s ease-in-out infinite; pointer-events: none; }
@keyframes cwi-bob { 50% { margin-top: -8px; } }
.cwi-say { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px) scale(0.6); opacity: 0; pointer-events: none;
  white-space: nowrap; background: #fff; color: #1f2937; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: opacity 0.2s, transform 0.2s; z-index: 5; }
.cwi-say.on { opacity: 1; transform: translate(-50%, -4px) scale(1); }
.cwi-hop { animation: cwi-hop2 0.5s ease-out 2; }
@keyframes cwi-hop2 { 50% { translate: 0 -9px; } }
.cwi-treat { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; z-index: 7; pointer-events: none;
  background: radial-gradient(circle, #fff 0 20%, rgba(255, 220, 120, 0.9) 35%, transparent 70%); animation: cwi-treat 1.8s ease-in-out infinite; }
.cwi-treat.found { animation: cwi-treat-found 0.9s ease-out forwards; }
@keyframes cwi-treat { 0%, 100% { opacity: 0.25; transform: scale(0.7); } 50% { opacity: 0.85; transform: scale(1.1); } }
@keyframes cwi-treat-found { to { opacity: 0; transform: scale(3); } }
.cwi-sound { border: 0; background: none; font-size: 1.3rem; cursor: pointer; padding: 2px 6px; }
.cwi-hint-btn { border: 2px solid #b08cf0; background: #f3ecff; color: #4b2a8c; font-weight: 800; border-radius: 12px; padding: 8px 14px; cursor: pointer; }
.pb-option.pb-option-gone { opacity: 0.25; filter: grayscale(1); cursor: default; }
.cwi-guide img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.cw-card-say { position: absolute; top: 6px; right: 40px; border: 0; background: none; font-size: 1.15rem; cursor: pointer; }

/* ---- Number Peaks towers share one stone hall; each grade tints it its own colour. */
.cwi-tower .cwi-board::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--cwi-tint); opacity: 0.32; mix-blend-mode: color; }

/* ---- A station's screen drawn inside its room (cwiRoomBackdrop, body.view-cw-room).
   The room's arena art fills the page behind a dimming wash, like the Story
   Quest chapter list; the screen itself sits on a panel framed in the room's
   tint, so every module stays readable without restyling it. */
html:has(body.view-cw-room) { background-color: #0d0a16; }
body.view-cw-room::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 8, 20, 0.35), rgba(10, 8, 20, 0.7)), var(--cwi-room-bg) center / cover no-repeat;
  image-rendering: pixelated;
}
body.view-cw-room #main-content {
  position: relative; z-index: 1; border: 18px solid transparent; border-radius: 38px; background-clip: padding-box;
  background-color: color-mix(in srgb, var(--color-bg, #fff) 93%, transparent);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--cwi-room-tint) 75%, #000);
}
/* the room's own scene as a banner across the top of the screen, named like a sign */
body.view-cw-room #main-content::before {
  content: var(--cwi-room-name); display: flex; align-items: flex-end; min-height: 118px; margin-bottom: 16px; padding: 12px 18px;
  border-radius: 16px; border: 3px solid color-mix(in srgb, var(--cwi-room-tint) 75%, #000); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(10, 8, 20, 0.05) 30%, rgba(10, 8, 20, 0.8)), var(--cwi-room-bg) center 45% / cover no-repeat;
  image-rendering: pixelated; color: #fff8e7; font-family: var(--font-display, inherit); font-weight: 800; font-size: 1.35rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.65); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
/* screens that already draw their own world (Story Quest) drop the panel */
body.view-cw-room #main-content:has(> .wq-themed) { background-color: transparent; box-shadow: none; }
body.view-cw-room #main-content:has(> .wq-themed)::before { display: none; }
@media (max-width: 640px) {
  body.view-cw-room #main-content { border-width: 8px; border-radius: 24px; }
  body.view-cw-room #main-content::before { min-height: 92px; font-size: 1.1rem; }
}

/* ---- The daily challenges themed to their room (cwiDailyTheme, body[data-cwi-daily]).
   PixelLab UI panels as 9-slice border-images; answer states stay readable as
   a coloured ring, so right / wrong never hides behind the wood. */
body[data-cwi-daily="dojo"] .math-question-card { background: none; border: solid transparent; border-width: 40px 24px 26px; border-radius: 0;
  border-image: url("./world/inside/dojo/daily-scroll-px.png") 56 34 34 fill / 40px 24px 26px stretch; box-shadow: none; color: #3b2412; image-rendering: pixelated; }
body[data-cwi-daily="dojo"] .math-question-number { color: #8a3a2a; font-weight: 800; }
body[data-cwi-daily="dojo"] .math-question-text { color: #2b1a0d; }
body[data-cwi-daily="dojo"] .math-progress-bar { background: #3a2216; border: 2px solid #1d100a; height: 12px; }
body[data-cwi-daily="dojo"] .math-progress-fill { background: linear-gradient(180deg, #d9473b, #9e2a22); }
body[data-cwi-daily="dojo"] .math-option-btn, body[data-cwi-daily="dojo"] .math-tool-btn {
  background: none; border: 9px solid transparent; border-radius: 0; border-image: url("./world/inside/dojo/daily-btn-px.png") 9 fill / 9px stretch;
  color: #fff4dc; text-shadow: 0 2px 0 #4a2612; image-rendering: pixelated; }
body[data-cwi-daily="dojo"] .math-option-btn:hover:not(.selected):not(.disabled) { background: none; border-color: transparent; filter: brightness(1.12); }

body[data-cwi-daily="lighthouse"] .eng-q-card { background: #f1e2bf; border: 22px solid transparent; border-radius: 0;
  border-image: url("./world/inside/lighthouse/daily-chart-px.png") 34 fill / 22px stretch; box-shadow: none; color: #1f2f4a; image-rendering: pixelated; }
body[data-cwi-daily="lighthouse"] .eng-q-text { color: #1b2a44; }
body[data-cwi-daily="lighthouse"] .eng-progress, body[data-cwi-daily="lighthouse"] .back-btn { color: #fff3d6; }
body[data-cwi-daily="lighthouse"] .eng-progress-bar { background: #1d2a40; border: 2px solid #0d1524; height: 12px; }
body[data-cwi-daily="lighthouse"] .eng-progress-fill { background: linear-gradient(90deg, #ffe58a, #ffc93c) !important; box-shadow: 0 0 10px rgba(255, 214, 90, 0.8); }
body[data-cwi-daily="lighthouse"] .eng-option-btn, body[data-cwi-daily="lighthouse"] .eng-hint-btn {
  background: none; border: solid transparent; border-width: 20px 44px; border-radius: 0; border-image: url("./world/inside/lighthouse/daily-btn-px.png") 10 22 fill / 20px 44px round;
  padding: 2px 6px; color: #fffaf0; font-weight: 700; text-shadow: 0 2px 0 #1d2a40, 0 0 4px #1d2a40; image-rendering: pixelated; }
body[data-cwi-daily="lighthouse"] .eng-hint-btn { border-width: 14px 30px; border-image-width: 14px 30px; padding: 0 4px; }
body[data-cwi-daily="lighthouse"] .eng-option-btn:hover { background: none; border-color: transparent; filter: brightness(1.12); }
body[data-cwi-daily="lighthouse"] .eng-hint-text { color: #1b2a44; }
body[data-cwi-daily="lighthouse"] .eng-daily-type-badge { background: #1d2a40; color: #fff3d6; }

body[data-cwi-daily] .math-option-btn.correct, body[data-cwi-daily] .eng-option-btn.correct { box-shadow: 0 0 0 4px #22c55e, 0 0 14px rgba(34, 197, 94, 0.7); background: none; color: #eaffea; }
body[data-cwi-daily] .math-option-btn.wrong, body[data-cwi-daily] .eng-option-btn.wrong { box-shadow: 0 0 0 4px #ef4444, 0 0 14px rgba(239, 68, 68, 0.6); background: none; color: #ffecec; }
body[data-cwi-daily] .cw-ico { width: auto; height: 1.25em; vertical-align: -0.25em; image-rendering: pixelated; }

/* The Bee Hive's Spelling Bee on a honeycomb (body[data-cwi-daily="bee-hive"]). */
body[data-cwi-daily="bee-hive"] .bee-card { background: #fdf3d6 padding-box; border: solid transparent; border-width: 52px 40px 24px; border-radius: 0; box-shadow: none;
  border-image: url("./world/inside/bee-hive/daily-bee-panel-px.png") 84 64 36 64 fill / 52px 40px 24px 40px stretch; color: #4a2c0c; image-rendering: pixelated; }
body[data-cwi-daily="bee-hive"] .bee-card :is(p, .bee-instr, .bee-note, .bee-of-list, .eng-end-count) { color: #5c3a12; }
body[data-cwi-daily="bee-hive"] .eng-end-top h2, body[data-cwi-daily="bee-hive"] .eng-end-count { color: #fff3d6; text-shadow: 0 2px 0 #3a2208; }
body[data-cwi-daily="bee-hive"] :is(.bee-hear, .bee-ask, .eng-end-btn) {
  background: none; border: solid transparent; border-width: 16px 18px 12px; border-radius: 0; box-shadow: none;
  border-image: url("./world/inside/bee-hive/daily-bee-btn-px.png") 12 14 10 14 fill / 16px 18px 12px 18px round;
  color: #3a2208; font-weight: 800; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.7); image-rendering: pixelated; }
body[data-cwi-daily="bee-hive"] .bee-ask { padding: 0 4px; }
body[data-cwi-daily="bee-hive"] .bee-hear { border-width: 22px 24px 16px; border-image-width: 22px 24px 16px 24px; padding: 4px 14px; }
body[data-cwi-daily="bee-hive"] .bee-ask.asked { filter: brightness(1.1) saturate(1.2); }
body[data-cwi-daily="bee-hive"] .bee-main { font-size: 1.15rem; }
body[data-cwi-daily="bee-hive"] .bee-main.bee-listening { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 200, 60, 0.9)); }
body[data-cwi-daily="bee-hive"] .bee-link { color: #7a3d0a; }
body[data-cwi-daily="bee-hive"] .bee-asked { background: #f6e2ad; color: #4a2c0c; border: 2px solid #d9a440; }
body[data-cwi-daily="bee-hive"] .bee-hear .cw-ico { height: 2.4rem; }

/* ---- Number Nim in the Nim Stone Garden, Sudoku in the Sudoku Shrine
   (cwiGameTheme -> body[data-cwi-daily]). Opened from the map place there is
   no room around the screen, so the place's PixelLab backdrop fills the page;
   from the Observatory the room's own backdrop stays. */
body[data-cwi-daily="nim-garden"]:not(.view-cw-room) #main-content,
body[data-cwi-daily="sudoku-shrine"]:not(.view-cw-room) #main-content { background: #1b1a24 var(--cwi-game-bg) center / cover fixed no-repeat; image-rendering: pixelated; min-height: calc(100vh - 60px); }
body[data-cwi-daily="nim-garden"] .back-btn, body[data-cwi-daily="sudoku-shrine"] .back-btn { background: #3a2e22; color: #fff3d6; border: 2px solid #1d150e; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
body[data-cwi-daily="nim-garden"] { --cwi-game-bg: url("./world/games/nim-backdrop-px.png"); }
body[data-cwi-daily="sudoku-shrine"] { --cwi-game-bg: url("./world/games/sudoku-backdrop-px.png"); }
body[data-cwi-daily="nim-garden"] .oly-screen, body[data-cwi-daily="sudoku-shrine"] .oly-screen { margin-top: 12px; padding: 4px 8px 12px; image-rendering: pixelated; }

/* Nim: a mossy stone tablet, the stones are PixelLab pebbles, buttons are slabs. */
body[data-cwi-daily="nim-garden"] .oly-screen { background: #c9cfc7 padding-box; color: #23302a;
  border: 30px solid transparent; border-image: url("./world/games/nim-panel-px.png") 48 fill / 30px stretch; }
body[data-cwi-daily="nim-garden"] :is(.oly-activity-title, .oly-instructions, .oly-nim-turn, .oly-nim-count, .oly-nim-row-label, .oly-nim-row-count, .oly-nim-log, .oly-subtitle) { color: #23302a; }
body[data-cwi-daily="nim-garden"] :is(.oly-nim-stone, .oly-nim-stone-btn) { font-size: 0; width: 34px; height: 28px; display: inline-block; vertical-align: middle;
  background: url("./world/games/pebble-px.png") center / contain no-repeat; border: 0; box-shadow: none; padding: 0; image-rendering: pixelated; }
body[data-cwi-daily="nim-garden"] .oly-nim-stone-btn { cursor: pointer; transition: transform 0.1s; }
body[data-cwi-daily="nim-garden"] .oly-nim-stone-btn:is(:hover, :focus-visible) { background-image: url("./world/games/pebble-gold-px.png"); transform: translateY(-3px); outline: none; }
body[data-cwi-daily="nim-garden"] :is(.oly-nim-pile, .oly-nim-row, .oly-nim-stones) { background: rgba(120, 104, 74, 0.18); border-radius: 12px; }
body[data-cwi-daily="nim-garden"] .oly-btn, body[data-cwi-daily="nim-garden"] .oly-activity-card {
  background: none; border: 12px solid transparent; border-radius: 0; border-image: url("./world/games/slab-px.png") 12 fill / 12px stretch;
  color: #f4f6f1; font-weight: 800; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); box-shadow: none; image-rendering: pixelated; }
body[data-cwi-daily="nim-garden"] .oly-activity-card :is(.oly-card-title, .oly-card-desc, .oly-card-progress) { color: #f4f6f1; }
body[data-cwi-daily="nim-garden"] .oly-btn.primary { filter: sepia(0.5) saturate(2.2) hue-rotate(60deg) brightness(0.95); }

/* Sudoku: a red-lacquer shrine scroll; cells are paper tiles, givens carved
   wood, the selected cell jade, an error keeps a red ring. */
body[data-cwi-daily="sudoku-shrine"] .oly-screen { background: #faebcc padding-box; color: #3b2412;
  border: 20px solid transparent; border-image: url("./world/games/sudoku-panel-px.png") 26 fill / 20px stretch; }
body[data-cwi-daily="sudoku-shrine"] :is(.oly-activity-title, .oly-instructions, .oly-subtitle) { color: #3b2412; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-grid { border: 4px solid #7a2a1d; background: #7a2a1d; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell { background: url("./world/games/tile-paper-px.png") center / 100% 100% no-repeat; color: #3b2412; border-color: #b8865a; image-rendering: pixelated; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell.given { background-image: url("./world/games/tile-wood-px.png"); color: #fff1d6; text-shadow: 0 1px 0 #000; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell.selected { background: url("./world/games/tile-jade-px.png") center / 100% 100% no-repeat !important; color: #12301f; outline: 3px solid #2f7a4f; box-shadow: none; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell:not(.given):not(.selected):hover { background: url("./world/games/tile-paper-px.png") center / 100% 100% no-repeat; filter: brightness(1.06); }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell.box-left { border-left: 3px solid #7a2a1d; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell.box-top { border-top: 3px solid #7a2a1d; }
body[data-cwi-daily="sudoku-shrine"] .oly-sudoku-cell.error { box-shadow: inset 0 0 0 3px #d9342b; color: #b0201a; }
body[data-cwi-daily="sudoku-shrine"] :is(.oly-sudoku-num, .oly-btn, .oly-activity-card) {
  background: url("./world/games/tile-wood-px.png") center / 100% 100% no-repeat; border: 2px solid #4a2412; border-radius: 6px;
  color: #fff1d6; font-weight: 800; text-shadow: 0 1px 0 #000; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); image-rendering: pixelated; }
body[data-cwi-daily="sudoku-shrine"] .oly-activity-card :is(.oly-card-title, .oly-card-desc, .oly-card-progress) { color: #fff1d6; }
body[data-cwi-daily="sudoku-shrine"] .oly-btn.primary { background-image: url("./world/games/tile-jade-px.png"); color: #12301f; text-shadow: none; }

/* The Story Shipwreck's treasure map (cwiShowMap): parchment under fog, a
   piece uncovered per chapter finished. */
.cwi-map { position: relative; margin: 10px 0 4px; border-radius: 8px; overflow: hidden; border: 3px solid #6b4220; line-height: 0; }
.cwi-map img { width: 100%; height: auto; image-rendering: pixelated; }
.cwi-map-fog { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); }
.cwi-map-fog span { background: #c9b48a; box-shadow: inset 0 0 0 1px rgba(107, 66, 32, 0.25); transition: opacity 0.6s; }
.cwi-map-fog span:nth-child(odd) { background: #c2ab7e; }
.cwi-map-fog span.found { opacity: 0; }
/* Hatches and doors to another deck. */
.cwi-link .cwi-tag { background: #6b4220; }
/* The hold is dark below deck: only the lanterns glow. */
.cwi-shipwreck-hold .cwi-ground { filter: brightness(0.62) saturate(0.8); }
