/* Hoku World game styles. Brand colors and fonts from the Hoku World Brand Guidelines (print and video values). */
@font-face { font-family: "Fredoka"; src: url("../assets/fonts/Fredoka-700.woff2") format("woff2"); font-weight: 500 700; font-display: block; }
@font-face { font-family: "Nunito"; src: url("../assets/fonts/Nunito-800.woff2") format("woff2"); font-weight: 600 900; font-display: block; }

:root {
  --navy: #1C2454;
  --yellow: #FFD65C;
  --coral: #F48069;
  --mist: #D6DCF5;
  --cream: #FFF4DE;
  --sky: #E6F7FA;
  --slate: #33405E;
  --teal: #2FB5C2;
  --deep-teal: #1F7F8A;
  --white: #FFFFFF;
  --ink: #222222;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--navy);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none;
  font-family: "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif; font-weight: 800; color: var(--navy);
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

#backdrop { position: fixed; inset: 0; background: var(--navy) center / cover no-repeat; }
#backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(28, 36, 84, 0.0); }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 1000px;
  transform-origin: 0 0; overflow: hidden; border-radius: 0;
}
.screen { position: absolute; inset: 0; animation: fadeIn 0.35s ease both; }
.layer { position: absolute; inset: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Brand logo ---------- */
.logo { display: flex; align-items: center; gap: 22px; font-family: "Fredoka", sans-serif; font-weight: 700; color: var(--white);
  -webkit-text-stroke: 10px var(--navy); paint-order: stroke fill; text-shadow: 0 7px 0 var(--navy); letter-spacing: 1px; line-height: 1; }
.logo svg { filter: drop-shadow(0 7px 0 var(--navy)); }

.corner-mark { position: absolute; right: 22px; bottom: 18px; width: 170px; opacity: 0.65; z-index: 50; pointer-events: none; }

/* ---------- Buttons ---------- */
.btn {
  position: absolute; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 34px; color: var(--navy);
  background: var(--white); border: 6px solid var(--navy); border-radius: 999px;
  box-shadow: 0 8px 0 var(--navy); cursor: pointer; transition: transform 0.08s, box-shadow 0.08s;
  padding: 0; z-index: 40;
}
.btn.yellow { background: var(--yellow); }
.btn.coral { background: var(--coral); color: var(--white); }
.btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--navy); }
.btn svg { width: 56%; height: 56%; }
.btn.round { border-radius: 50%; }
.btn.home { left: 26px; top: 24px; width: 116px; height: 116px; }
.btn.topright { right: 26px; top: 24px; width: 104px; height: 104px; }
.btn.grownups { right: 26px; top: 24px; height: 72px; padding: 0 26px; font-size: 24px; border-width: 4px; box-shadow: 0 5px 0 var(--navy); }
.btn.grownups svg { width: 26px; height: 26px; }
.btn.website { right: auto; left: 26px; }
.btn.website svg { width: 24px; height: 24px; }

/* ---------- Captions ---------- */
#caption {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  max-width: 1040px; min-height: 84px; display: flex; align-items: center; gap: 18px;
  background: var(--cream); border: 5px solid var(--navy); border-radius: 999px; box-shadow: 0 6px 0 var(--navy);
  padding: 8px 34px 8px 10px; font-size: 30px; line-height: 1.2; color: var(--navy); opacity: 0; transition: opacity 0.2s, transform 0.2s;
  z-index: 60; pointer-events: none; white-space: normal; width: max-content; max-width: 1100px;
}
#caption.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#caption .face { width: 64px; height: 64px; border-radius: 50%; background: var(--sky) center 18% / 150% no-repeat; border: 4px solid var(--navy); flex: none; }
#caption .ph { font-family: "Nunito"; font-size: 15px; letter-spacing: 1.5px; color: var(--coral); text-transform: uppercase; margin-left: 6px; }
body.no-captions #caption { display: none; }

/* ---------- Characters ---------- */
.char { position: absolute; transform-origin: 50% 100%; z-index: 20; }
.char img { width: 100%; height: auto; display: block; }
.bob { animation: bob 2.6s ease-in-out infinite; }
.bob.d1 { animation-delay: -0.6s; } .bob.d2 { animation-delay: -1.2s; } .bob.d3 { animation-delay: -1.8s; } .bob.d4 { animation-delay: -2.2s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(-1.5deg); } }
.hop { animation: hop 0.6s ease-out; }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-50px) rotate(3deg); } 70% { transform: translateY(0) scaleY(0.94); } 100% { transform: translateY(0); } }
.talking { animation: talk 0.5s ease-in-out infinite; }
@keyframes talk { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(-2deg) scale(1.02, 0.99); } }

/* ---------- Title ---------- */
.title-logo { position: absolute; left: 0; right: 0; top: 70px; justify-content: center; font-size: 150px; }
.title-sub { position: absolute; left: 0; right: 0; top: 250px; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: 50px; color: var(--yellow);
  -webkit-text-stroke: 7px var(--navy); paint-order: stroke fill; text-shadow: 0 5px 0 var(--navy); }
.btn.play { left: 665px; top: 330px; width: 270px; height: 270px; border-width: 9px; box-shadow: 0 12px 0 var(--navy); animation: pulse 1.8s ease-in-out infinite; }
.btn.play svg { width: 50%; height: 50%; margin-left: 18px; }
@keyframes pulse { 0%, 100% { scale: 1; } 50% { scale: 1.05; } }

/* ---------- Map ---------- */
.map-title { position: absolute; left: 160px; top: 34px; font-family: "Fredoka"; font-weight: 700; font-size: 64px; color: var(--white);
  -webkit-text-stroke: 9px var(--navy); paint-order: stroke fill; text-shadow: 0 6px 0 var(--navy); }
.world { position: absolute; width: 330px; height: 330px; border-radius: 50%; border: 8px solid var(--navy); box-shadow: 0 12px 0 var(--navy);
  cursor: pointer; overflow: visible; transition: transform 0.12s; z-index: 30; }
.world:active { transform: translateY(8px); box-shadow: 0 4px 0 var(--navy); }
.world .art { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.world .label { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap; background: var(--white); border: 5px solid var(--navy);
  border-radius: 999px; padding: 6px 24px; font-family: "Fredoka"; font-weight: 700; font-size: 32px; box-shadow: 0 5px 0 var(--navy); }
.world.locked { filter: saturate(0.35) brightness(0.95); }
.world.small { width: 210px; height: 210px; }
.world.small .label { font-size: 22px; padding: 4px 16px; bottom: -26px; border-width: 4px; }
.world .lock { position: absolute; right: -6px; top: -6px; width: 74px; height: 74px; border-radius: 50%; background: var(--yellow); border: 5px solid var(--navy); display: flex; align-items: center; justify-content: center; }
.world .lock svg { width: 38px; height: 38px; }
.wiggle { animation: wiggle 0.5s ease; }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -6deg; } 40% { rotate: 6deg; } 60% { rotate: -4deg; } 80% { rotate: 3deg; } }

/* ---------- Flight ---------- */
.ship { position: absolute; width: 380px; z-index: 25; }
.countdown { position: absolute; left: 0; right: 0; top: 240px; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: 300px; color: var(--yellow);
  -webkit-text-stroke: 16px var(--navy); paint-order: stroke fill; text-shadow: 0 12px 0 var(--navy); z-index: 45; pointer-events: none; }
.countdown.pop { animation: cpop 0.9s ease-out both; }
@keyframes cpop { 0% { transform: scale(0.3); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* ---------- Splash World ---------- */
.sea { background: linear-gradient(#8EE3EC 0%, #3CC1D0 30%, #1E8FB0 70%, #1A6E99 100%); }
.fish { position: absolute; width: 170px; height: 120px; cursor: pointer; z-index: 25; transition: transform 0.25s; }
.fish svg { width: 100%; height: 100%; overflow: visible; }
.fish.swim { animation: swimbob 2.2s ease-in-out infinite; }
@keyframes swimbob { 0%, 100% { translate: 0 0; } 50% { translate: 8px -10px; } }
.fish.tapped { cursor: default; }
.fish .fsvg { width: 100%; height: 100%; }
.fish.hint .fsvg { animation: hintpulse 0.9s ease-in-out infinite; }
.badge { position: absolute; left: 50%; top: -34px; transform: translateX(-50%) scale(0); width: 72px; height: 72px; border-radius: 50%; background: var(--yellow); border: 5px solid var(--navy);
  font-family: "Fredoka"; font-weight: 700; font-size: 44px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 var(--navy); transition: transform 0.25s cubic-bezier(.3,1.6,.5,1); }
.fish.tapped .badge { transform: translateX(-50%) scale(1); }
.badge.flash { animation: badgeflash 0.6s ease; }
@keyframes badgeflash { 50% { transform: translateX(-50%) scale(1.35); background: var(--white); } }
.answers { position: absolute; left: 0; right: 0; bottom: 130px; display: flex; justify-content: center; gap: 70px; z-index: 45; }
.answer { position: relative; width: 190px; height: 190px; border-radius: 50%; background: var(--white); border: 8px solid var(--navy); box-shadow: 0 10px 0 var(--navy);
  font-family: "Fredoka"; font-weight: 700; font-size: 120px; display: flex; align-items: center; justify-content: center; cursor: pointer; animation: rise 0.4s cubic-bezier(.3,1.5,.5,1) both; }
.answer:nth-child(2) { animation-delay: 0.08s; } .answer:nth-child(3) { animation-delay: 0.16s; }
.answer.right { background: var(--yellow); }
@keyframes rise { from { transform: translateY(80px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.bubble { position: absolute; border-radius: 50%; border: 3px solid rgba(255,255,255,0.75); background: rgba(255,255,255,0.15); animation: rise-bubble linear infinite; pointer-events: none; }
@keyframes rise-bubble { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-1100px); opacity: 0.2; } }
.progress { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); display: flex; gap: 16px; z-index: 40; }
.progress i { width: 36px; height: 36px; border-radius: 50%; border: 5px solid var(--navy); background: rgba(255,255,255,0.6); }
.progress i.on { background: var(--yellow); }

/* ---------- Night World ---------- */
.twinkle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: tw 3s ease-in-out infinite; pointer-events: none; }
@keyframes tw { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.dot { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; cursor: pointer; z-index: 30; }
.dot svg { width: 100%; height: 100%; overflow: visible; }
.dot .num { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: "Fredoka"; font-weight: 700; font-size: 40px; color: var(--navy); }
.dot.lit .core { fill: var(--yellow); }
.dot.hint { animation: hintpulse 0.9s ease-in-out infinite; }
@keyframes hintpulse { 50% { transform: scale(1.25); } }
.reveal-label { position: absolute; left: 0; right: 0; top: 30px; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: 72px; color: var(--yellow);
  -webkit-text-stroke: 9px var(--navy); paint-order: stroke fill; text-shadow: 0 6px 0 #0d1233; z-index: 45; animation: rise 0.5s both; }

/* ---------- Kai Cove menu ---------- */
.kc-card { position: absolute; width: 380px; height: 420px; border-radius: 40px; background: var(--cream); border: 8px solid var(--navy); box-shadow: 0 12px 0 var(--navy);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 30; }
.kc-card:active { transform: translateY(8px); box-shadow: 0 4px 0 var(--navy); }
.kc-card .big { font-family: "Fredoka"; font-weight: 700; font-size: 128px; line-height: 1; color: var(--coral); -webkit-text-stroke: 8px var(--navy); paint-order: stroke fill; }
.kc-card .cap { font-family: "Fredoka"; font-weight: 700; font-size: 40px; }

/* ---------- Tracing ---------- */
.trace-board { position: absolute; left: 420px; top: 90px; width: 760px; height: 820px; border-radius: 48px; background: var(--white); border: 8px solid var(--navy); box-shadow: 0 12px 0 var(--navy); z-index: 20; }
.trace-board svg { position: absolute; inset: 30px; width: 700px; height: 760px; overflow: visible; }
.trace-strip { position: absolute; right: 26px; top: 150px; bottom: 140px; width: 150px; display: flex; flex-direction: column; gap: 14px; align-items: center; overflow: hidden; z-index: 30; }
.chip { width: 108px; height: 108px; border-radius: 28px; background: var(--white); border: 5px solid var(--navy); box-shadow: 0 5px 0 var(--navy); flex: none;
  font-family: "Fredoka"; font-weight: 700; font-size: 64px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.chip.done::after { content: ""; position: absolute; right: -10px; top: -10px; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' fill='none' stroke='%231C2454' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat; border: 4px solid var(--navy); }
.chip.current { background: var(--yellow); }
.arrowbtn { position: absolute; width: 110px; height: 110px; }

/* ---------- Coloring ---------- */
.pages { position: absolute; left: 150px; right: 150px; top: 170px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 48px; justify-items: center; z-index: 30; }
.page-thumb { aspect-ratio: 3 / 4; background: var(--white) center / cover no-repeat; border: 7px solid var(--navy); border-radius: 26px; box-shadow: 0 8px 0 var(--navy); cursor: pointer; height: 330px; }
.page-thumb:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--navy); }
.canvas-wrap { position: absolute; left: 480px; top: 18px; width: 645px; height: 860px; background: var(--white); border: 8px solid var(--navy); border-radius: 30px; box-shadow: 0 10px 0 var(--navy); overflow: hidden; z-index: 20; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.palette { position: absolute; left: 170px; top: 150px; width: 260px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; z-index: 30; }
.swatch { width: 110px; height: 110px; border-radius: 50%; border: 6px solid var(--navy); box-shadow: 0 6px 0 var(--navy); cursor: pointer; transition: transform 0.12s; }
.swatch.sel { transform: scale(1.14); outline: 7px solid var(--yellow); outline-offset: 3px; }

/* ---------- Sticker reward + book ---------- */
.dim { position: absolute; inset: 0; background: rgba(28, 36, 84, 0.72); z-index: 70; animation: fadeIn 0.3s both; }
.sticker { position: absolute; border-radius: 50%; border: 8px solid var(--white); box-shadow: 0 0 0 6px var(--navy), 0 14px 0 6px rgba(13,18,51,0.5); overflow: hidden; }
.sticker img { position: absolute; left: 10%; top: 8%; width: 80%; height: 88%; object-fit: contain; }
.sticker-big { left: 560px; top: 160px; width: 480px; height: 480px; z-index: 75; animation: peel 0.8s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes peel { from { transform: rotate(-30deg) scale(0.2); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
.book { position: absolute; left: 130px; right: 130px; top: 170px; bottom: 120px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 30px; align-content: start; z-index: 30; }
.book .slot { position: relative; aspect-ratio: 1; border-radius: 50%; border: 6px dashed rgba(255,255,255,0.6); }
.book .slot .sticker { inset: 0; animation: none; }
.sparkle { position: absolute; width: 26px; height: 26px; z-index: 80; pointer-events: none; animation: sparkle 1.2s ease-out forwards; }
@keyframes sparkle { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(160deg); opacity: 0; } }

/* ---------- Grown-ups ---------- */
.panel { position: absolute; left: 120px; right: 120px; top: 70px; bottom: 70px; background: var(--white); border: 7px solid var(--navy); border-radius: 36px; box-shadow: 0 10px 0 var(--navy);
  z-index: 75; padding: 40px 54px; overflow-y: auto; touch-action: pan-y; font-family: "Nunito"; font-weight: 700; font-size: 24px; line-height: 1.5; color: var(--slate); -webkit-user-select: text; user-select: text; }
.panel h2 { font-family: "Fredoka"; font-weight: 700; font-size: 44px; color: var(--navy); margin: 0 0 6px; }
.panel h3 { font-family: "Fredoka"; font-weight: 700; font-size: 30px; color: var(--navy); margin: 26px 0 6px; }
.panel .eyebrow { font-weight: 800; font-size: 16px; letter-spacing: 1.5px; color: var(--coral); text-transform: uppercase; }
.panel table { border-collapse: collapse; width: 100%; font-size: 22px; }
.panel td, .panel th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--mist); }
.panel th { color: var(--navy); font-weight: 800; }
.panel a { color: var(--deep-teal); text-decoration: none; }
.panel .row { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 10px 22px; border: 4px solid var(--navy); border-radius: 999px; background: var(--cream); cursor: pointer; font-family: "Fredoka"; font-weight: 600; color: var(--navy); }
.toggle.on { background: var(--yellow); }
.contact { display: grid; gap: 8px; margin-top: 8px; }
.contact a, .contact span { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; color: var(--slate); }
.contact svg { width: 28px; height: 28px; flex: none; }
.close-x { position: absolute; right: 140px; top: 90px; width: 84px; height: 84px; z-index: 80; }
.gate { position: absolute; left: 380px; top: 230px; width: 840px; height: 470px; background: var(--white); border: 7px solid var(--navy); border-radius: 36px; box-shadow: 0 10px 0 var(--navy);
  z-index: 85; text-align: center; padding: 40px; font-family: "Nunito"; }
.gate h2 { font-family: "Fredoka"; font-size: 46px; margin: 10px 0; color: var(--navy); }
.gate p { font-size: 30px; color: var(--slate); margin: 8px 0 30px; }
.gate .opts { display: flex; justify-content: center; gap: 30px; }
.gate .opt { width: 140px; height: 140px; border-radius: 30px; border: 6px solid var(--navy); box-shadow: 0 7px 0 var(--navy); background: var(--cream); font-family: "Fredoka"; font-weight: 700; font-size: 60px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- Rotate prompt ---------- */
#rotate { position: fixed; inset: 0; z-index: 999; background: var(--navy); color: var(--white); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 30px; font-family: "Fredoka"; font-size: 30px; text-align: center; padding: 30px; }
#rotate img { width: 40vw; max-width: 220px; }
#rotate .phone { width: 90px; height: 150px; border: 8px solid var(--yellow); border-radius: 22px; animation: turn 2s ease-in-out infinite; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: flex; } }

/* Prefers reduced motion: keep it calm */
@media (prefers-reduced-motion: reduce) {
  .bob, .fish.swim, .twinkle, .btn.play, .bubble { animation: none !important; }
}

/* ================= Version 0.2 ================= */
/* Kai Cove home */
.house-hit { position: absolute; z-index: 25; cursor: pointer; border-radius: 30px; }
.house-pin { position: absolute; width: 150px; z-index: 35; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pin-icon { width: 120px; height: 120px; border-radius: 50%; background: var(--cream); border: 6px solid var(--navy); box-shadow: 0 7px 0 var(--navy); display: flex; align-items: center; justify-content: center; }
.pin-icon svg { width: 76%; height: 76%; }
.pin-label { white-space: nowrap; background: var(--white); border: 5px solid var(--navy); border-radius: 999px; padding: 4px 18px; font-family: "Fredoka"; font-weight: 700; font-size: 26px; box-shadow: 0 5px 0 var(--navy); }
.pin-label.takeoff { position: absolute; width: 190px; text-align: center; background: var(--yellow); font-size: 30px; z-index: 36; cursor: pointer; animation: pulse 1.8s ease-in-out infinite; }
.hub-ship { position: absolute; z-index: 34; cursor: pointer; }
.hub-ship img { position: relative; }
.ship-glow { position: absolute; left: -20%; top: -10%; width: 140%; height: 130%; border-radius: 50%; background: radial-gradient(rgba(255,214,92,0.75), rgba(255,214,92,0) 65%); animation: pulse 1.8s ease-in-out infinite; }

/* World picker and world menus */
.planet .label { font-size: 26px; padding: 4px 18px; bottom: -28px; z-index: 5; }
.planet .char { z-index: 2; }
.planet .lock { width: 64px; height: 64px; }
.planet .lock svg { width: 32px; height: 32px; }
.game-tile { justify-content: flex-start; padding-top: 30px; gap: 18px; }
.game-tile .cap { font-size: 34px; text-align: center; padding: 0 14px; line-height: 1.1; }
.tile-art { width: 260px; height: 220px; border-radius: 26px; background: rgba(47,181,194,0.25); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-art svg { width: 92%; height: 92%; }
.tile-star { position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; }

/* Rainbow Reef */
.coral { position: absolute; z-index: 22; cursor: pointer; }
.coral svg, .critter svg { width: 100%; height: 100%; overflow: visible; }
.critter { position: absolute; z-index: 40; cursor: grab; touch-action: none; }
.critter .cin { width: 100%; height: 100%; animation: swimbob 2.2s ease-in-out infinite; }
.dragging { cursor: grabbing; z-index: 60 !important; filter: drop-shadow(0 12px 0 rgba(13,18,51,0.3)); }

/* Bubble Pop */
.numbubble { position: absolute; left: 0; top: 0; border-radius: 50%; z-index: 30; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.9), rgba(255,255,255,0.35) 30%, rgba(255,255,255,0.18) 70%); border: 6px solid var(--navy);
  font-family: "Fredoka"; font-weight: 700; color: var(--navy); }
.numbubble.popped { transition: transform 0.3s, opacity 0.3s; opacity: 0; scale: 1.5; }

/* Day or Night */
.dn-side { position: absolute; top: 0; width: 800px; height: 1000px; overflow: hidden; cursor: pointer; }
.dn-day { left: 0; background: linear-gradient(#8ED3F2, #DDF3FB); }
.dn-night { left: 800px; background: linear-gradient(#141A40, #262C6B); }
.dn-side > svg { position: absolute; inset: 0; }
.dn-head { position: absolute; top: 110px; left: 0; right: 0; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: 64px; color: var(--white); -webkit-text-stroke: 8px var(--navy); paint-order: stroke fill; text-shadow: 0 6px 0 var(--navy); }
.dn-tray { position: absolute; left: 60px; right: 60px; bottom: 120px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.dn-mini, .dn-card { background: var(--white); border: 6px solid var(--navy); border-radius: 30px; box-shadow: 0 8px 0 var(--navy); padding: 10px; }
.dn-mini { width: 110px; height: 110px; padding: 6px; border-width: 4px; border-radius: 20px; box-shadow: 0 4px 0 var(--navy); }
.dn-mini svg, .dn-card svg { width: 100%; height: 100%; }
.dn-card { position: absolute; z-index: 45; cursor: grab; touch-action: none; }
.dn-card img, .dn-mini img { width: 100%; height: 100%; object-fit: contain; }

/* Firefly Friends */
.lantern { position: absolute; z-index: 25; }
.ff-num { position: absolute; z-index: 30; background: var(--white); border: 6px solid var(--navy); border-radius: 26px; box-shadow: 0 7px 0 var(--navy); text-align: center; }
.ff-num .big { font-family: "Fredoka"; font-weight: 700; font-size: 72px; line-height: 1; margin-top: 6px; color: var(--navy); }
.ff-num .dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.ff-num .dots i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--navy); }
.ff-num .dots i.on { background: var(--yellow); }
.firefly { position: absolute; left: 0; top: 0; width: 80px; height: 80px; z-index: 32; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.firefly i { width: 24px; height: 24px; border-radius: 50%; background: #FFF6B8; box-shadow: 0 0 18px 12px rgba(255,230,128,0.85); animation: flicker 1.8s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }

/* Drawing tools */
.toolcol { position: absolute; left: 30px; top: 160px; display: flex; flex-direction: column; gap: 14px; z-index: 40; }
.tool { width: 104px; height: 104px; border-radius: 28px; background: var(--white); border: 5px solid var(--navy); box-shadow: 0 6px 0 var(--navy); cursor: pointer; padding: 6px; }
.tool svg { width: 100%; height: 100%; }
.tool.sel { background: var(--yellow); transform: translateX(10px); }
.palette2 { position: absolute; left: 165px; top: 160px; width: 300px; display: grid; grid-template-columns: repeat(3, 88px); gap: 18px 16px; z-index: 40; }
.palette2 .swatch { width: 88px; height: 88px; }
.stampchoice { width: 88px; height: 88px; border-radius: 22px; background: var(--white); border: 5px solid var(--navy); box-shadow: 0 5px 0 var(--navy); padding: 4px; cursor: pointer; }
.stampchoice img { width: 100%; height: 100%; object-fit: contain; }
.stampchoice.sel { background: var(--yellow); }
.rightcol { position: absolute; right: 40px; top: 150px; display: flex; flex-direction: column; align-items: center; gap: 26px; z-index: 40; }
.rightcol .btn { position: relative; }
.rbtn { width: 110px; height: 110px; }
.rbtn.big { width: 130px; height: 130px; }
.sizebtn { width: 96px; height: 96px; border-radius: 50%; background: var(--white); border: 5px solid var(--navy); box-shadow: 0 5px 0 var(--navy); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sizebtn i { display: block; border-radius: 50%; background: var(--navy); }
.sizebtn.sel { background: var(--yellow); }

/* v0.3: painted art from Runway */
.planet { border: none; box-shadow: none; background: none; }
.planet:active { box-shadow: none; }
.planet .art.painted { border-radius: 0; overflow: visible; filter: drop-shadow(0 10px 0 rgba(10, 16, 50, 0.55)); }
.planet .art.painted img { pointer-events: none; }
.world.planet.locked { filter: saturate(0.4) brightness(0.85); }
.coral img, .critter img, .dn-card img, .dn-mini img, .tile-art img { pointer-events: none; user-select: none; -webkit-user-drag: none; }
.coral img { filter: drop-shadow(0 6px 0 rgba(16, 60, 90, 0.35)); }
.critter img { filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.25)); }

/* v0.5: taglines, players, My Book */
.char.trip { animation: trip 0.9s ease-in-out; }
@keyframes trip { 0% { transform: rotate(0); } 15% { transform: translateX(6px) rotate(9deg); } 35% { transform: translateX(-8px) rotate(-11deg); } 55% { transform: translateX(5px) rotate(7deg); } 75% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
.book-tabs { position: absolute; right: 60px; top: 36px; display: flex; gap: 18px; z-index: 35; }
.book-tab { display: flex; align-items: center; gap: 10px; height: 84px; padding: 0 26px 0 14px; border-radius: 999px; border: 5px solid var(--navy); background: var(--cream); box-shadow: 0 6px 0 var(--navy); font-family: "Fredoka"; font-weight: 700; font-size: 28px; color: var(--navy); cursor: pointer; }
.book-tab svg { width: 56px; height: 56px; }
.book-tab.sel { background: var(--yellow); }
.book-area { position: absolute; inset: 0; z-index: 30; }
.gallery { position: absolute; left: 130px; right: 130px; top: 170px; bottom: 60px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 34px; align-content: start; overflow-y: auto; padding: 10px; }
.gallery .frame { background: var(--white); padding: 12px; border-radius: 10px; box-shadow: 0 0 0 5px var(--navy), 0 10px 0 5px rgba(13,18,51,0.5); cursor: pointer; }
.gallery .frame img { display: block; width: 100%; height: 220px; object-fit: contain; background: #fff; }
.gallery-empty { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; max-width: 900px; margin: 60px auto; padding: 28px 36px; background: var(--cream); border: 6px solid var(--navy); border-radius: 30px; font-family: "Fredoka"; font-weight: 600; font-size: 32px; color: var(--navy); cursor: pointer; }
.gallery-empty svg { width: 110px; height: 110px; flex: none; }
.viewer-pic { position: absolute; background: #fff; border-radius: 16px; box-shadow: 0 0 0 8px var(--white), 0 0 0 14px var(--navy); z-index: 75; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer-pic img { max-width: 100%; max-height: 100%; }
.viewer-btns { position: absolute; display: flex; flex-direction: column; gap: 26px; z-index: 76; }
.viewer-btns .btn { position: relative; width: 120px; height: 120px; }
.viewer-btns .btn.armed { background: var(--coral); }
.btn.undo-pop { right: 60px; bottom: 60px; width: 130px; height: 130px; z-index: 60; animation: rise 0.4s both; }
.save-note { font-size: 20px; color: #505050; min-height: 1em; }

/* ---------- v0.6: print and save sheet (grown-ups) ---------- */
.gate.outsheet { height: 490px; }
.out-opt { width: 200px !important; height: 200px !important; flex-direction: column; gap: 6px; font-size: 26px !important; }
.out-opt svg { width: 104px; height: 104px; }
.out-opt.busy { opacity: 0.55; }
.out-note { font-size: 24px !important; min-height: 1.2em; margin: 26px 0 0 !important; color: #505050; }
#hw-print { display: none; }
@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#hw-print) { display: none !important; }
  #hw-print { display: block; }
  @page { margin: 0.4in; }
  @page port { size: portrait; margin: 0.4in; }
  @page land { size: landscape; margin: 0.4in; }
  .hw-pp { display: block; text-align: center; break-after: page; page-break-after: always; break-inside: avoid; }
  .hw-pp:last-child { break-after: auto; page-break-after: auto; }
  .hw-pp.port { page: port; }
  .hw-pp.land { page: land; }
  .hw-pp img { display: inline-block; width: auto; height: auto; max-width: 100%; border: 1px solid #bbb; }
  .hw-pp.port img { max-height: 9.6in; }
  .hw-pp.land img { max-height: 6.9in; }
  .hw-cap { font: 600 10pt "Nunito", Arial, sans-serif; color: #666; margin-top: 0.12in; }
}

/* ---------- v0.6: capital or lowercase toggle on the tracing screen ---------- */
.case-toggle { position: absolute; left: 70px; top: 190px; display: flex; flex-direction: column; gap: 22px; z-index: 30; }
.case-btn { width: 130px; height: 130px; border-radius: 34px; background: var(--white); border: 7px solid var(--navy); box-shadow: 0 8px 0 var(--navy);
  font-family: "Fredoka"; font-weight: 700; font-size: 84px; line-height: 1; color: var(--navy); cursor: pointer; padding: 0 0 8px; }
.case-btn.sel { background: var(--yellow); }
.case-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--navy); }

/* Starry Sky (preview 0.8): Fix the Star Shell, Big and Small Planets, Light the Way */
.sky-panel { position: absolute; z-index: 21; border-radius: 48px; border: 8px solid var(--navy); box-shadow: 0 12px 0 var(--navy);
  background: linear-gradient(#5B6BB0, #3A4590); }
.sky-panel .lights { position: absolute; left: 40px; right: 40px; top: 22px; display: flex; justify-content: space-between; }
.sky-panel .lights i { width: 30px; height: 30px; border-radius: 50%; border: 5px solid var(--navy); background: #2A3170; transition: background 0.3s, box-shadow 0.3s; }
.sky-panel .lights i.on { background: var(--yellow); box-shadow: 0 0 18px 4px rgba(255,214,92,0.8); }
.sky-panel.fixed { animation: panelglow 1.2s ease-in-out 2; }
@keyframes panelglow { 50% { box-shadow: 0 12px 0 var(--navy), 0 0 60px 20px rgba(255,214,92,0.55); } }
.shape-hole { position: absolute; z-index: 23; cursor: pointer; }
.shape-hole svg, .shape-piece svg, .planet-ob svg { width: 100%; height: 100%; overflow: visible; display: block; }
.shape-piece { position: absolute; z-index: 40; cursor: grab; touch-action: none; transition: left 0.45s, top 0.45s, rotate 0.45s; }
.shape-piece.dragging, .planet-ob.dragging { transition: none; }
.shape-piece.lifted { filter: drop-shadow(0 0 14px rgba(255,230,128,0.95)); scale: 1.08; }
.shape-piece.set { cursor: default; z-index: 24; }
.orbit-zone { position: absolute; z-index: 21; border-radius: 50%; border: 6px dashed rgba(255,244,222,0.75); cursor: pointer; }
.orbit-zone .zlabel { position: absolute; left: 0; right: 0; top: -78px; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: 54px;
  color: var(--white); -webkit-text-stroke: 7px var(--navy); paint-order: stroke fill; }
.planet-ob { position: absolute; z-index: 40; cursor: grab; touch-action: none; transition: left 0.5s, top 0.5s, width 0.5s, height 0.5s; }
.planet-ob.hint { animation: hintpulse 0.9s ease-in-out infinite; }
.size-slot { position: absolute; z-index: 21; border-radius: 50%; border: 5px dashed rgba(255,244,222,0.6); }
.size-arrow { position: absolute; z-index: 20; }
.hider { position: absolute; z-index: 22; cursor: pointer; }
.hider img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; display: block; pointer-events: none; }
.hider.found { animation: hop 0.6s ease both; }
.moon-rock { position: absolute; z-index: 23; pointer-events: none; }
.dark { position: absolute; inset: 0; z-index: 30; pointer-events: none; transition: opacity 0.6s; }
.beam-ring { position: absolute; z-index: 31; border-radius: 50%; border: 4px solid rgba(255,244,190,0.55); pointer-events: none; }

/* World menu tile descriptions and the in-game "how to play" card (0.9) */
.game-tile .desc { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 23px; line-height: 1.25; color: #4A5272; text-align: center; padding: 0 22px; margin-top: -6px; }
.howto { position: absolute; right: 24px; top: 22px; width: 440px; z-index: 46; display: flex; align-items: center; gap: 14px;
  background: var(--cream); border: 5px solid var(--navy); border-radius: 26px; box-shadow: 0 6px 0 var(--navy); padding: 12px 18px; transition: opacity 0.3s; pointer-events: none; }
.howto-text { flex: 1; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 24px; line-height: 1.22; color: var(--navy); }
.howto-big { flex: none; min-width: 74px; height: 74px; padding: 0 12px; border-radius: 37px; background: var(--yellow); border: 5px solid var(--navy);
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 42px; line-height: 64px; text-align: center; color: var(--navy); }
.howto-big:empty { display: none; }
.dn-head { top: 160px; }

/* ---------- Dino World (preview, November 10, 2026) ---------- */
.rumble { animation: rumble 0.35s linear; }
@keyframes rumble { 0%, 100% { translate: 0 0; } 20% { translate: -4px 1px; } 40% { translate: 4px -1px; } 60% { translate: -3px 0; } 80% { translate: 2px 1px; } }
.dhint { animation: hintpulse 0.9s ease-in-out 3; }
.dflash { animation: hintpulse 0.6s ease-in-out 1; }
.dino-obj { position: absolute; z-index: 22; display: flex; }
.dino-obj.pickable { cursor: pointer; filter: drop-shadow(0 0 14px rgba(255, 214, 92, 0.95)); animation: pulse 1.2s ease-in-out infinite; }
.dino-startline { position: absolute; z-index: 21; border-radius: 4px; background: rgba(28, 36, 84, 0.55); }
.dino-print { position: absolute; z-index: 23; pointer-events: none; }
.dino-print svg { width: 100%; height: 100%; display: block; }
.dino-print.ghost { opacity: 0.85; animation: pulse 1.4s ease-in-out infinite; }
@keyframes stampin { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fern-scene { position: absolute; z-index: 22; }
.fern-scene > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.fern-bush { transition: transform 1.1s cubic-bezier(.5,0,.3,1); }
.fern-scene.open .fern-bush.left { transform: translateX(-62%); }
.fern-scene.open .fern-bush.right { transform: translateX(62%); }
.fern-dino.munch svg { animation: munch 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes munch { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg) translateY(4px); } }
.fern-cards { position: absolute; left: 300px; right: 60px; top: 600px; display: flex; justify-content: center; gap: 40px; z-index: 45; }
.fern-card { width: 250px; height: 220px; border-radius: 30px; background: var(--white); border: 7px solid var(--navy); box-shadow: 0 9px 0 var(--navy);
  display: flex; flex-direction: column; align-items: center; padding: 10px 12px 8px; cursor: pointer; animation: rise 0.45s both; font: inherit; }
.fern-card .pic { width: 100%; flex: 1; min-height: 0; }
.fern-card .nm { font-family: "Fredoka"; font-weight: 700; font-size: 25px; color: var(--navy); }
.fern-card.right { background: var(--yellow); }
.build-picture { position: absolute; z-index: 22; background: #FFF8E8; border: 7px solid var(--navy); border-radius: 28px; box-shadow: 0 9px 0 var(--navy); }
.build-picture > div { position: absolute; inset: 0; }
.pblock { position: absolute; }
.pblock.next { filter: drop-shadow(0 0 8px #FFB400) drop-shadow(0 0 4px #FFB400); }
.build-block { position: absolute; z-index: 30; padding: 0; border: none; background: none; cursor: pointer; }
.build-block.placed { z-index: 25; cursor: default; }
.build-ghost { position: absolute; z-index: 24; border: 5px dashed rgba(28, 36, 84, 0.6); border-radius: 16px; background: rgba(255, 255, 255, 0.35); }
.char.tiptoe { animation: tiptoe 0.5s ease-in-out infinite; }
@keyframes tiptoe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
