:root {
  --bg: #f4f1ea;
  --ink: #2b2723;
  --panel: #ffffff;
  --line: #e2ddd2;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}
#scene { position: fixed; inset: 0; }
#ui {
  position: fixed;
  top: 24px; right: 24px;
  width: 280px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
#ui h1 {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
#ui .sub {
  font-size: 11px;
  color: #8a8378;
  margin-bottom: 18px;
}
.group { margin-bottom: 18px; }
.group h2 {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #8a8378;
  margin-bottom: 8px;
}
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 44px; height: 44px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  outline: 2px solid var(--line);
  outline-offset: 0;
  transition: transform 0.12s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.label {
  font-size: 12px;
  margin-top: 8px;
  color: var(--ink);
}
.toggle-row { display: flex; gap: 8px; }
.toggle-row button, .btn {
  flex: 1;
  font-size: 11px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
}
.toggle-row button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn { display: block; width: 100%; text-align: center; }
.btn + .btn { margin-top: 6px; }
#hint {
  position: fixed;
  left: 24px; bottom: 20px;
  font-size: 11px;
  color: #8a8378;
}
/* embed / mobile: UI becomes a bottom sheet */
@media (max-width: 640px) {
  #ui {
    top: auto;
    left: 12px; right: 12px; bottom: 12px;
    width: auto;
    max-height: 42vh;
    padding: 14px 16px;
  }
  #ui .sub { margin-bottom: 12px; }
  .group { margin-bottom: 12px; }
  .swatch { width: 36px; height: 36px; }
  #hint { display: none; }
}
