#camera {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 0;
  background: #0d0b0c;
}

body.ar-live #camera { display: block; }
body.ar-live #scene { z-index: 1; }
body.ar-live #loading { background: rgba(20, 16, 18, 0.85); }

body.ar-live .hud h1,
body.ar-live .hud p {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.ar-live .hud h1 span { color: #ffd9ea; }

#note {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #8a6a5c;
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.04em;
  text-shadow: none;
}

#note[hidden] { display: none; }

.hud-ar h1 { display: flex; gap: 12px; align-items: baseline; justify-content: center; }

.hud-ar h1 span {
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 700;
  color: #b9a2b8;
}

.hud-ar p { max-width: 860px; margin-left: auto; margin-right: auto; padding: 0 16px; }

#palette {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  z-index: 5;
}

#palette button {
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 14px rgba(180, 150, 165, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  color: #8a6a5c;
  font: inherit;
  font-size: clamp(11px, 1.3vw, 13px);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

#palette button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(180, 150, 165, 0.3); }
#palette button:active { transform: translateY(0) scale(0.96); }

#tools {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}

#tools button,
#tools .back {
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #a08a80;
  font: inherit;
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

#tools button:hover,
#tools .back:hover { background: rgba(255, 255, 255, 0.92); color: #8a6a5c; }

@media (max-width: 560px) {
  .hud-ar p { font-size: 10px; letter-spacing: 0.04em; }
  #palette { gap: 6px; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  #palette button { padding: 8px 11px; }
}
