* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { font: 16px/1.4 "Segoe UI", system-ui, sans-serif; color: #17372b; background: #7cc9f7; }
html, body { margin: 0; background: #7cc9f7 url("assets/treehouse-bg.webp?v=th4") center bottom / cover no-repeat fixed; min-height: 100svh; }
main { width: min(1390px,100%); margin: auto; padding: 12px 18px 16px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 10px; }
h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #dbe7dc;
  border-bottom: 3.5px solid #b9d2c0;
  box-shadow: 0 6px 16px rgba(18, 52, 40, 0.12), inset 0 1px 2px #ffffff;
  font: 800 clamp(0.92rem, 1.18vw, 1.08rem)/1.2 'Manrope', "Segoe UI", sans-serif;
  letter-spacing: -0.15px;
  color: #103b4d;
  text-align: right;
}
h1 span {
  display: inline-block;
  padding: 4px 11px 4.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #108c68 0%, #086e51 100%);
  color: #ffffff;
  font: 700 0.82em/1.1 'Fredoka', 'Manrope', sans-serif;
  letter-spacing: 0.2px;
  margin-left: 0;
  white-space: nowrap;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}
header p { margin: 0; font-size: .87rem; }
.header-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9b3cf8 0%, #731de0 58%, #5711b5 100%);
  border: 1.5px solid #bc85ff;
  border-bottom: 4.5px solid #3c0982;
  color: #ffffff;
  text-decoration: none;
  font: 700 14px/1 'Fredoka', 'Manrope', "Segoe UI", sans-serif;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 1.5px 2px rgba(0, 0, 0, 0.28);
  box-shadow: 0 7px 15px rgba(72, 14, 145, 0.32), inset 0 2px 3px rgba(255, 255, 255, 0.34);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.header-back-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  color: #ffffff;
}
.layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(185px,230px); gap: 13px; align-items: start; }
.scene { position: relative; width: 100%; aspect-ratio: 4/3; container-type: inline-size; border-radius: 20px; overflow: hidden; isolation: isolate; background: #326239; border: 3px solid #fffef3; box-shadow: 0 10px 30px #624d2926; touch-action: none; --x: 50%; --y: 47%; --radius: 13cqi; }
.art, .zoom { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.art { object-fit: fill; }
.zoom, .lens { display: none; }
.scanning .zoom { display: block; clip-path: circle(var(--radius) at var(--x) var(--y)); }
.revealing .zoom { display: block; clip-path: none; }
.scanning .lens { display: block; }
.lens { position: absolute; pointer-events: none; left: var(--x); top: var(--y); width: calc(var(--radius) * 2); aspect-ratio: 1; transform: translate(-50%,-50%); border-radius: 50%; border: clamp(2px,.42vw,6px) solid #e9efc6; box-shadow: 0 0 0 3px #205b43, 0 4px 14px #123e3d70; }
.lens::after { content:''; position: absolute; left: 80%; top: 86%; width: 30%; height: 9%; border: 3px solid #205b43; background: #edc66f; border-radius: 999px; transform: rotate(45deg); }
.label, .reveal-tag { position: absolute; border-radius: 99px; background: #fffce4; color: #18362b; font-weight: 800; padding: 4px 9px; font-size: clamp(.69rem,2.3cqi,1rem); pointer-events: none; }
.label { left: clamp(20%,var(--x),80%); top: clamp(9%,calc(var(--y) - 16%),88%); transform: translate(-50%,-50%); white-space: nowrap; }
.reveal-tag { display: none; transform: translate(-50%,-50%); }
.revealing .reveal-tag { display: block; }
.panel,.dock { background: #fffdf8; border: 1px solid #d9e4d5; box-shadow: 0 8px 26px #5e50351f; }
.panel { border-radius: 18px; overflow: hidden; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; padding: 11px 12px; background: #f1f8ef; }
h2 { font-size: .96rem; margin: 0; }
output { border-radius: 999px; background: #d8f3e8; padding: 2px 8px; font-size: .79rem; font-weight: 850; color: #0f6349; }
button { font: inherit; cursor: pointer; color: inherit; }
button:focus-visible { outline: 3px solid #166e56; outline-offset: -3px; }
#list { display: grid; padding: 4px 8px; }
.discovery { display:flex; align-items:center; justify-content:space-between; padding: 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-weight: 720; }
.discovery:hover { background: #edf7ed; }
.check { color: #486256; }
.found .check { color: #067454; font-weight: 900; }
.fact { padding: 10px 12px; background: #f3f8ef; font-size: .88rem; }
.fact p { margin: 4px 0 0; }
.dock { display:flex; flex-wrap:wrap; justify-content:center; gap: 5px; width:fit-content; margin: 9px auto 0; padding: 6px; border-radius: 24px; }
.dock button { border-radius: 20px; border: 1px solid #dbe5db; background: #f0f6ee; padding: 6px 10px; font-size: .8rem; font-weight: 750; }
.dock button[aria-pressed=true] { background: #087557; color:white; }
.dock button:disabled { opacity: .5; cursor: default; }
:fullscreen { overflow: auto; background: #7cc9f7 url("assets/treehouse-bg.webp?v=th4") center bottom / cover no-repeat fixed; }
@media (max-width: 991.98px) { html, body { background-attachment: scroll; } }
@media(max-width:700px) { main { padding: 8px; } .layout { grid-template-columns: 1fr; gap: 8px; } header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; } h1 { font-size: 0.85rem; padding: 4px 6px 4px 11px; gap: 6px; } header p { font-size: .78rem; } #list { grid-template-columns: repeat(2,1fr); } .scene { border-radius: 12px; } }

/* Alternate artwork aligns with the base scene at the same scale. */
.zoom {
  background: url("assets/jungle-magic.png") center / 100% 100% no-repeat;
}
.zoom .art { visibility: hidden; }
#voice {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #acd6c0;
  border-radius: 999px;
  background: #f3fff1;
  color: #125941;
  font-size: .85rem;
  font-weight: 800;
}
#voice[aria-pressed=true] { background: #087557; color: white; }
@media(max-width:700px) { #voice { margin-top: 6px; } }