* { 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/number-treehouse.png") 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;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px 6px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 232, 188, 0.14) 0px,
      rgba(255, 232, 188, 0.14) 3px,
      rgba(142, 72, 18, 0.08) 3px,
      rgba(142, 72, 18, 0.08) 6px
    ),
    linear-gradient(180deg, #f2b76e 0%, #d9873b 50%, #b46120 100%);
  border: 2px solid #9c4f16;
  border-bottom: 4.5px solid #78390c;
  box-shadow: inset 0 2px 2px rgba(255, 243, 214, 0.72), 0 8px 18px rgba(64, 30, 6, 0.24);
  font-size: 1rem;
  letter-spacing: 0;
}
h1 span {
  position: relative;
  display: inline-block;
  padding: 5px 24px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #df1923 0%, #bc1019 56%, #910a11 100%);
  border: 2px solid #7d080e;
  box-shadow: inset 0 2px 4px rgba(255, 160, 160, 0.28), inset 0 -2.5px 0 rgba(78, 4, 9, 0.55);
  font: 700 clamp(0.95rem, 1.38vw, 1.28rem)/1.18 'Fredoka', 'Manrope', sans-serif;
  letter-spacing: 0.4px;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 2px 3px rgba(72, 5, 8, 0.42);
}
h1 span::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  border: 1.5px dashed rgba(253, 224, 115, 0.8);
  pointer-events: none;
}
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/number-treehouse.png") 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 { padding: 4px 8px 5px; } h1 span { padding: 4px 14px 5px; font-size: 0.88rem; } header p { font-size: .78rem; } #list { grid-template-columns: repeat(2,1fr); } .scene { border-radius: 12px; } }


.scene { background: #b0da79 url("assets/garden.png") center / 100% 100%; }
.garden-grid { position: absolute; inset: 15% 8% 10%; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 5px; }
.spot,.secret { position: relative; grid-column: span 2; min-width: 0; min-height: 0; display: grid; place-items: center; }
.spot:nth-child(4),.secret:nth-child(4) { grid-column: 2 / span 2; }
.spot { border: 0; background: transparent; padding: 0; }
.spot img,.secret img { width: 96%; height: 94%; object-fit: contain; min-height: 0; pointer-events: none; mix-blend-mode: multiply; }
.magic { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.scanning .magic { visibility: visible; clip-path: circle(var(--radius) at var(--x) var(--y)); }
.show-all .magic { visibility: visible; clip-path: none; }
.scanning.show-all .lens { display: none; }
.secret { background: radial-gradient(ellipse,#fff2a866,transparent 69%); }
.secret .magic-art { filter: saturate(1.23) drop-shadow(0 0 7px #fff5b2); }
.tokens { width: 75%; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(3px,.7cqi,7px); padding: 7px; border-radius: 28%; background: #e7efac96; }
.ten,.unit { display: grid; place-items: center; }
.ten { width: 22%; border-radius: 6px; background: #287657; color: white; font-size: clamp(.5rem,1.9cqi,.92rem); font-weight: 800; }
.unit { width: clamp(5px,1.3cqi,13px); aspect-ratio: 1; border-radius: 50%; background: #ffd455; border: 1px solid #a16d1a; }
.aside-title { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; background: #f1f8ef; }
#progress { border-radius: 99px; padding: 2px 8px; font-size: .8rem; color: #0f6349; background: #d8f3e8; }
#list button { padding: 8px; border: 0; border-radius: 9px; background: transparent; text-align: start; font-weight: 720; }
#list button:hover,#list .found { background: #e7f5e6; }
.dock { align-items: center; }
.dock label { margin-inline: 5px; font-size: .79rem; font-weight: 750; }
.dock select { font: inherit; color: inherit; border: 1px solid #dbe5db; border-radius: 15px; padding: 3px 5px; }
#hint { text-align: center; font-size: .8rem; margin: 5px 0 0; }
/* Full aligned scene pair for the first trail. */
.scene.illustrated { background-image: url("assets/trail-1-5.png"); }
.illustrated .magic { background: url("assets/trail-1-5-magic.png") center / 100% 100% no-repeat; }
.illustrated #base { inset: 0; display: block; }
.illustrated .spot { position: absolute; transform: translate(-50%,-50%); border-radius: 22%; }
.illustrated .spot:hover { background: transparent; }
.scene .label { font-size: clamp(.72rem,2.5cqi,1.1rem); }
.secret { background: radial-gradient(ellipse,#bb81f468,transparent 68%); }
.secret img.magic-art { filter: hue-rotate(46deg) saturate(1.55) drop-shadow(0 0 10px #f5dcff); }
.secret .ten { background: #7843c0; box-shadow: 0 0 7px #e4afff; }
.secret .unit { background: #ffe67f; box-shadow: 0 0 6px #fff1a8; }
/* The sidebar is a vertical stack; only individual discovery rows are flex. */
aside.panel {
  display: block;
  min-width: 0;
  padding: 0;
  background: #fffdf8;
}
aside.panel .aside-title { gap: 8px; }
#progress { flex: 0 0 auto; white-space: nowrap; }
#list { grid-template-columns: minmax(0,1fr); }
#list .discovery { width: 100%; min-width: 0; gap: 8px; }
#list .check { flex: 0 0 18px; text-align: center; }
.nest-home { max-width: 470px; text-align:center; margin: clamp(35px,16vh,140px) auto; padding: 24px; }
.nest-home p { margin: 10px 0 15px; }
/* Hide the bottom controls on the presentation screen. */
#dock, #hint { display: none; }

.sound-help { display:block; margin:8px auto; padding:7px 12px; border:1px solid #9fc7ac; border-radius:99px; background:#fff2ce; color:#174c3e; font-weight:800; }
