/* ---------------------------------------------------------------
   Giraffe demo -- styles
   --------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #0d0b09;
  font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", Arial, sans-serif;
  color: #f4ead8;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* ---------- title ---------- */
#title {
  position: fixed; top: 22px; left: 26px;
  pointer-events: none;
  text-shadow: 0 2px 14px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.9);
}
#title h1 {
  margin: 0;
  font-size: 25px; font-weight: 600; letter-spacing: .045em;
  font-style: italic;
  color: #fbf3e2;
}
#title p {
  margin: 4px 0 0;
  font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(244,234,216,.62);
}

/* ---------- hud ---------- */
#hud {
  position: fixed; top: 24px; right: 26px;
  font-size: 11.5px; letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
  color: rgba(244,234,216,.55);
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
  pointer-events: none;
}

/* ---------- panel ---------- */
#panel {
  position: fixed; left: 26px; bottom: 24px;
  width: 320px; max-width: calc(100vw - 52px);
  padding: 18px 20px 16px;
  border-radius: 14px;
  background: rgba(22, 18, 14, .58);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(244,234,216,.14);
  box-shadow: 0 18px 48px rgba(0,0,0,.5);
  transition: transform .28s ease, opacity .28s ease;
}
#panel.hidden { transform: translateY(calc(100% + 40px)); opacity: 0; }

#togglePanel {
  position: absolute; top: -14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(244,234,216,.2);
  background: rgba(30,24,18,.9);
  color: #f4ead8; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0;
}
#togglePanel:hover { background: rgba(60,48,36,.95); }

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .05em;
  color: rgba(244,234,216,.85);
}
.row output {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: #e8c98d;
  min-width: 62px; text-align: right;
}

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, #c99a52, #6d573a);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; margin-top: -5.5px;
  border-radius: 50%; background: #f0dcb4;
  border: 1px solid rgba(0,0,0,.45);
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
input[type=range]::-moz-range-track {
  height: 4px; border-radius: 3px; background: #6d573a;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #f0dcb4; border: 1px solid rgba(0,0,0,.45);
}

.buttons { display: flex; gap: 8px; margin: 14px 0 12px; }
.buttons button {
  flex: 1;
  padding: 8px 6px;
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: rgba(244,234,216,.82);
  background: rgba(244,234,216,.07);
  border: 1px solid rgba(244,234,216,.16);
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  font-family: inherit;
}
.buttons button:hover {
  background: rgba(244,234,216,.15);
  color: #fff;
}
.buttons button.on {
  background: rgba(201,154,82,.24);
  border-color: rgba(224,190,124,.5);
  color: #f3d9a4;
}

.hint {
  margin: 0;
  font-size: 11px; line-height: 1.55;
  color: rgba(244,234,216,.5);
}
.hint b { color: rgba(244,234,216,.78); font-weight: 600; }

/* ---------- status / errors ---------- */
#status {
  display: none;
  position: fixed; inset: 0;
  align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(10,8,6,.92);
  font-size: 15px; line-height: 1.6;
  text-align: center;
  color: #ffb4a2;
  z-index: 20;
}

/* ---------- loading veil ---------- */
#veil {
  position: fixed; inset: 0; z-index: 15;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 45%, #1d1811, #0b0906 70%);
  transition: opacity .5s ease, visibility .5s ease;
}
#veil.gone { opacity: 0; visibility: hidden; }
.veil-text {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(244,234,216,.55);
}
.spinner {
  width: 34px; height: 34px;
  border: 2px solid rgba(244,234,216,.16);
  border-top-color: #e0be7c;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  #title h1 { font-size: 19px; }
  #title p { font-size: 10px; }
  #panel { width: calc(100vw - 40px); left: 20px; bottom: 18px; padding: 14px 16px 12px; }
  #hud { display: none; }
}
