body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f7f3ec;                    /* warm off-white */
  color: #222;
}
h1 { color: #2a6; }

/* Scroll zoom: the tall section is the scroll distance (more height = slower zoom) */
.scroll-zoom { height: 300vh; position: relative; }
.sticky {
  position: sticky;                       /* stays on screen while the section scrolls */
  top: 0;
  height: 100vh;
  height: 100dvh;
}
model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);      /* readable on top of the tree */
  white-space: nowrap;
  opacity: 0.9;
  transition: opacity 0.3s;
  pointer-events: none;
}
.scroll-hint.hidden { opacity: 0; }

.add-btn {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: #c62828;
  color: white;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  opacity: 0;                             /* hidden until the zoom is nearly done */
  pointer-events: none;
  transition: opacity 0.3s;
}
.add-btn.show { opacity: 1; pointer-events: auto; }

/* Ornaments: hotspots pinned to the 3D tree */
.ornament {
  width: 22px;
  aspect-ratio: 2 / 3;                    /* same shape as ornament.png */
  padding: 0;
  border: none;
  background: url("images/ornament.png") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
  cursor: pointer;
  opacity: var(--ornament-opacity, 0);    /* fades in as you zoom out (set by script.js) */
  transition: opacity 0.2s;
}
.ornament:hover, .ornament:focus { scale: 1.3; }
/* Hide ornaments on the far side of the tree */
.ornament.back { opacity: 0; pointer-events: none; }

/* The visitor's own ornament: glows and can be dragged */
.ornament.mine {
  cursor: grab;
  touch-action: none;                     /* on phones, dragging moves the ornament, not the page */
  /* The glow is drawn inside a bigger box instead of with filter: drop-shadow,
     which spills outside the box and leaves a trail behind when dragged */
  width: 36px;
  background:
    url("images/ornament.png") center / 22px auto no-repeat,          /* the ornament, same size as others */
    radial-gradient(closest-side, rgba(255, 213, 79, 0.9), rgba(255, 213, 79, 0));   /* the glow behind it */
  filter: none;
}
.ornament.dragging { cursor: grabbing; scale: 1.3; }

/* Message bubble shown on hover or tap (positioned by script.js) */
.tip {
  position: fixed;                        /* placed relative to the screen, not the tree */
  z-index: 10;                            /* above all ornaments */
  width: max-content;
  max-width: min(240px, calc(100vw - 16px));
  pointer-events: none;                   /* doesn't block the mouse */
  padding: 8px 10px;
  background: white;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}
.tip strong { display: block; margin-bottom: 2px; }
.tip em { display: block; margin-top: 4px; color: #8a6d00; font-size: 12px; }
.tip[hidden] { display: none; }

/* Popup */
dialog {
  border: none;
  border-radius: 12px;
  padding: 24px;
  width: min(400px, 90vw);                /* fits on phones */
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
dialog::backdrop { background: rgba(0,0,0,0.5); }   /* dark overlay behind it */

dialog label { display: block; margin-bottom: 12px; }
dialog input, dialog textarea {
  display: block; width: 100%; padding: 8px; margin-top: 4px;
  box-sizing: border-box;
}
.buttons { display: flex; justify-content: flex-end; gap: 8px; }