/* The Booklings' Big Adventure — cozy story game for ages 5–9 */
.adv-page { background: linear-gradient(180deg, #2B2350 0, #3D2F78 380px, var(--cream) 380px); }
.adv-page .howto { margin-top: 22px; }
.adv-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.adv-tips li { list-style: none; background: var(--cream); border-radius: 16px; padding: 12px 14px; }
.howto ul.adv-tips { padding: 0; }

#adventure { width: 100%; }
.adv-frame {
  position: relative; width: 100%; aspect-ratio: 16/10;
  border-radius: 28px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--honey), 0 24px 60px rgba(0,0,0,.35);
  background: #1d1640; color: var(--ink); font-family: var(--font);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
@media (max-width: 760px) {
  .adv-frame { aspect-ratio: 3/4; min-height: 620px; }
}

.adv-screen { position: absolute; inset: 0; display: none; }
.adv-screen.on { display: block; }
.adv-bg { position: absolute; inset: 0; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; }
.adv-world { position: absolute; inset: 0; z-index: 2; }

.adv-hud { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.adv-hud > * { pointer-events: auto; }
.adv-chip {
  font: inherit; font-weight: 700; font-size: .95rem; border: 0; cursor: pointer;
  background: #fff; color: var(--ink); padding: 10px 14px; min-height: 48px;
  border-radius: 999px; box-shadow: 0 4px 0 #E6DCC2, 0 8px 18px rgba(43,35,80,.15);
  display: inline-flex; align-items: center; gap: 6px;
}
.adv-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 #E6DCC2; }
.adv-chip.on { background: var(--honey); }
.adv-chip.ghost { background: rgba(255,255,255,.82); }
.adv-spacer { flex: 1; }
.adv-goal {
  background: rgba(43,35,80,.82); color: #fff; font-weight: 700; font-size: 1.05rem;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}

/* title */
.adv-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; z-index: 3; padding: 20px; }
.adv-title h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); margin: 0 0 8px; color: var(--ink); text-shadow: 0 3px 0 rgba(255,255,255,.7); }
.adv-title .lead { font-size: 1.2rem; font-weight: 600; background: rgba(255,255,255,.88); padding: 10px 18px; border-radius: 18px; margin: 0 0 18px; max-width: 34em; }
.adv-title .btn-row { justify-content: center; }
.adv-tog { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 16px; }
.adv-tog button { font: inherit; font-weight: 700; border: 0; background: transparent; padding: 10px 20px; border-radius: 999px; cursor: pointer; min-height: 48px; color: var(--ink); }
.adv-tog button[aria-pressed="true"] { background: var(--leaf); color: #fff; }

/* pick a friend */
.adv-pick { position: absolute; inset: 0; z-index: 3; padding: 70px 16px 16px; overflow: auto; }
.adv-pick h2 { text-align: center; color: var(--ink); text-shadow: 0 2px 0 #fff; margin: 0 0 12px; }
.adv-friends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 720px; margin: 0 auto; }
@media (min-width: 900px) { .adv-friends { grid-template-columns: repeat(5, 1fr); } }
.adv-friend {
  font: inherit; border: 0; cursor: pointer; background: rgba(255,255,255,.92);
  border-radius: 22px; padding: 10px 6px 12px; text-align: center; color: var(--ink);
  box-shadow: 0 6px 0 rgba(43,35,80,.12), 0 10px 20px rgba(43,35,80,.1);
  min-height: 120px;
}
.adv-friend:hover, .adv-friend:focus { transform: translateY(-3px); background: var(--honey); }
.adv-friend img { width: 88px; height: 88px; object-fit: contain; margin: 0 auto 4px; display: block; }
.adv-friend b { display: block; font-size: 1.05rem; }

/* map pins */
.adv-pin {
  position: absolute; transform: translate(-50%, -86%); width: 96px; border: 0; background: none;
  cursor: pointer; color: var(--ink); padding: 0; z-index: 3; text-align: center;
}
.adv-pin img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.28)); display: block; margin: 0 auto; }
.adv-pin .lbl { display: inline-block; background: #fff; border-radius: 999px; font-weight: 700; font-size: .78rem; padding: 3px 9px; box-shadow: 0 3px 0 rgba(43,35,80,.12); line-height: 1.2; margin-top: -4px; }
.adv-pin.done .lbl { background: var(--honey); }
.adv-pin .badge { position: absolute; top: -4px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--leaf); color: #fff; font-size: 14px; display: grid; place-items: center; font-weight: 700; box-shadow: 0 2px 0 #2F9346; }
.adv-pin:hover img, .adv-pin:focus img { transform: scale(1.08); }
.adv-pin.finale-pin { width: 120px; }
.adv-pin.finale-pin .lbl { background: var(--berry); color: #fff; font-size: .9rem; padding: 6px 12px; }

/* dialogue */
.adv-dialog {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 8;
  background: rgba(255,248,230,.96); border-radius: 24px; padding: 12px 14px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: 0 12px 32px rgba(43,35,80,.2); backdrop-filter: blur(6px);
}
.adv-dialog.hidden { display: none; }
.adv-dialog .face { width: 92px; height: 92px; object-fit: contain; flex-shrink: 0; }
.adv-dialog .body { flex: 1; min-width: 0; }
.adv-dialog .who { font-size: .88rem; font-weight: 700; color: var(--honey-deep); letter-spacing: .02em; text-transform: uppercase; margin: 0 0 2px; }
.adv-dialog .line { font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 600; line-height: 1.35; margin: 0; }
.adv-dialog .acts { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.adv-ico {
  font: inherit; font-weight: 700; font-size: 1.3rem; width: 56px; height: 56px; border: 0; border-radius: 18px;
  cursor: pointer; background: var(--sky); color: var(--ink); box-shadow: 0 4px 0 #2C9BE0;
}
.adv-ico.next { background: var(--honey); box-shadow: 0 4px 0 var(--honey-deep); width: auto; min-width: 56px; padding: 0 16px; font-size: 1.05rem; }
.adv-ico:active { transform: translateY(3px); box-shadow: 0 1px 0 #2C9BE0; }

/* characters in a scene */
.adv-actor { position: absolute; z-index: 3; pointer-events: none; filter: drop-shadow(0 10px 10px rgba(0,0,0,.2)); }
.adv-actor img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* farm sort */
.adv-egg {
  position: absolute; width: 78px; height: 92px; border: 0; background: none; cursor: pointer; padding: 0; z-index: 4;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,.2));
}
.adv-egg svg { width: 100%; height: 100%; display: block; }
.adv-egg.sel { transform: scale(1.15) translateY(-8px); z-index: 5; filter: drop-shadow(0 8px 10px rgba(240,138,0,.5)); }
.adv-egg.gone { visibility: hidden; pointer-events: none; }
.adv-bin {
  position: absolute; width: 120px; min-height: 110px; border: 0; cursor: pointer; z-index: 4;
  border-radius: 20px 20px 28px 28px; font: inherit; font-weight: 700; color: #fff; font-size: 1.05rem;
  box-shadow: 0 6px 0 rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px;
}
.adv-bin:hover, .adv-bin:focus { transform: translateY(-3px); }
.adv-bin .n { background: rgba(0,0,0,.25); border-radius: 999px; padding: 0 8px; font-size: .9rem; }

/* pond */
.adv-duck {
  position: absolute; width: 92px; height: 92px; border: 0; background: none; cursor: pointer; padding: 0; z-index: 4;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.25));
}
.adv-duck img { width: 100%; height: 100%; object-fit: contain; }
.adv-duck .num {
  position: absolute; top: -8px; right: -8px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--honey); color: var(--ink); font-weight: 700; font-size: 1.15rem;
  display: none; place-items: center; box-shadow: 0 3px 0 var(--honey-deep);
}
.adv-duck.counted .num { display: grid; }
.adv-nums { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 5; display: none; gap: 8px; flex-wrap: wrap; justify-content: center; width: 90%; }
.adv-nums.on { display: flex; }
.adv-nums button {
  font: inherit; font-weight: 700; font-size: 1.6rem; width: 64px; height: 64px; border: 0; border-radius: 18px;
  cursor: pointer; background: #fff; color: var(--ink); box-shadow: 0 5px 0 #E6DCC2;
}

/* leaves */
.adv-leaf {
  position: absolute; width: 86px; height: 86px; border: 0; background: none; cursor: pointer; padding: 0; z-index: 4;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.2));
}
.adv-leaf svg { width: 100%; height: 100%; display: block; }
.adv-leaf.got { pointer-events: none; opacity: 0; transform: scale(.3); transition: .3s; }

/* path stones */
.adv-stone {
  position: absolute; width: 70px; height: 48px; border: 0; border-radius: 50%; cursor: pointer; z-index: 4;
  background: radial-gradient(circle at 30% 30%, #F4E4C1, #C9A36A 70%);
  box-shadow: 0 6px 0 #8A6A3A, 0 0 0 4px rgba(255,255,255,.15); transform: translate(-50%, -50%);
}
.adv-stone.next { box-shadow: 0 6px 0 #8A6A3A, 0 0 0 6px #FFC234, 0 0 22px #FFC234; animation: adv-pulse 1.1s ease-in-out infinite; }
.adv-stone.done { background: radial-gradient(circle at 30% 30%, #FFE08A, #E0B000); }
@keyframes adv-pulse { 50% { transform: translate(-50%, -50%) scale(1.12); } }

/* bubbles */
.adv-bub {
  position: absolute; width: 100px; height: 100px; border: 0; border-radius: 50%; cursor: pointer; z-index: 4;
  display: grid; place-items: center; font-size: 2.4rem;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.9), rgba(255,255,255,.35) 46%, rgba(255,255,255,.15));
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.55), 0 8px 16px rgba(0,0,0,.2);
  animation: adv-float 4.5s ease-in-out infinite;
  transform: translate(-50%, -50%);
}
.adv-bub.sel { box-shadow: inset 0 0 0 5px #FFC234, 0 0 20px #FFC234; }
.adv-bub.pop { animation: adv-pop .35s forwards; pointer-events: none; }
@keyframes adv-float { 50% { margin-top: -10px; } }
@keyframes adv-pop { to { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }

/* hidden objects */
.adv-find {
  position: absolute; width: 86px; height: 86px; border: 0; background: transparent; cursor: pointer;
  transform: translate(-50%, -50%); z-index: 4; border-radius: 20px;
}
.adv-find.hint { box-shadow: 0 0 0 4px #FFC234, 0 0 18px #FFC234; animation: adv-pulse2 1.2s ease-in-out infinite; }
.adv-find.found { pointer-events: none; background: rgba(255,255,255,.5); box-shadow: 0 0 0 4px var(--leaf); }
.adv-find.found::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: #2F9346; font-weight: 700; }
@keyframes adv-pulse2 { 50% { transform: translate(-50%, -50%) scale(1.08); } }
.adv-list {
  position: absolute; right: 12px; top: 64px; z-index: 5; background: rgba(255,248,230,.94);
  border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); font-weight: 700; font-size: .95rem; max-width: 180px;
}
.adv-list li { list-style: none; padding: 4px 0; }
.adv-list li.got { text-decoration: line-through; opacity: .55; }

/* payton balloon */
.adv-breathe { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 4; padding-bottom: 80px; }
.adv-balloon {
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #A9D8FF, #4E8FE8);
  box-shadow: inset -12px -16px 0 rgba(0,0,0,.08), 0 20px 40px rgba(78,143,232,.35);
  transform: scale(.62); transition: transform 3.2s ease-in-out;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.3rem; text-align: center;
}
.adv-balloon.big { transform: scale(1.18); }
.adv-breathe .acts { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

/* celebration / stickers */
.adv-pop {
  position: absolute; inset: 0; z-index: 9; background: rgba(43,35,80,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.adv-pop.hidden { display: none; }
.adv-card {
  background: #fff; border-radius: 28px; padding: 24px 22px 22px; text-align: center;
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); position: relative; z-index: 2;
}
.adv-card h3 { font-size: 1.8rem; margin: 0 0 8px; }
.adv-sticker { width: 120px; height: 120px; margin: 8px auto 12px; }
.adv-book { position: absolute; inset: 0; z-index: 9; background: linear-gradient(180deg, #FFEFC7, #FFF8E6); padding: 58px 16px 16px; overflow: auto; }
.adv-book.hidden { display: none; }
.adv-book h2 { text-align: center; margin: 0 0 8px; }
.adv-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 680px; margin: 0 auto; }
@media (max-width: 600px) { .adv-slots { grid-template-columns: repeat(2, 1fr); } }
.adv-slot { background: #fff; border-radius: 22px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.adv-slot.empty { background: repeating-linear-gradient(45deg, #fff, #fff 8px, #FFF3C4 8px, #FFF3C4 16px); color: var(--muted); }
.adv-slot b { display: block; margin-top: 6px; font-size: .95rem; }
.adv-slot svg, .adv-slot .art { width: 88px; height: 88px; }

.adv-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.adv-bit { position: absolute; top: -10px; width: 12px; height: 18px; border-radius: 3px; animation: adv-fall linear forwards; }
@keyframes adv-fall { to { transform: translateY(110vh) rotate(360deg); opacity: .8; } }

.adv-shake { animation: adv-shake .4s; }
@keyframes adv-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (max-width: 760px) {
  .adv-pin { width: 78px; }
  .adv-pin img { width: 62px; height: 62px; }
  .adv-dialog .face { width: 72px; height: 72px; }
  .adv-dialog .line { font-size: 1.12rem; }
  .adv-egg { width: 70px; height: 82px; }
  .adv-bin { width: 100px; min-height: 96px; font-size: .95rem; }
  .adv-bub { width: 86px; height: 86px; font-size: 2rem; }
  .adv-list { right: 8px; top: auto; bottom: 118px; }
}

.adv-hud .adv-goal { position: static; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.adv-pin img { background: rgba(255,255,255,.82); border-radius: 50%; padding: 2px; }
.adv-stone { width: 76px; height: 76px; font: inherit; font-weight: 700; font-size: 1.4rem; color: var(--ink); display: grid; place-items: center; }
.adv-stone span { background: rgba(255,255,255,.85); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
@media (max-width: 760px) {
  .adv-page { padding-top: 12px; padding-bottom: 30px; }
  .adv-page h1 { font-size: 1.7rem; }
  .adv-page .sub { display: none; }
  .adv-page .crumbs { margin-bottom: 6px; }
  .adv-hud .adv-goal { font-size: .85rem; padding: 8px 10px; max-width: 46%; }
}

.adv-howto { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin: 0 0 16px; }
.adv-howto div { background:rgba(255,255,255,.94); border-radius:18px; padding:10px 14px; min-width:88px; box-shadow:0 4px 0 rgba(43,35,80,.1); }
.adv-howto span { display:block; font-size:1.5rem; }
.adv-howto small { display:block; font-weight:700; font-size:.85rem; }
