* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #dfe3f0;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* The canvas is sized to exact device pixels and upscaled in the shader,
     so the browser never resamples it. This is just a safety net. */
  image-rendering: pixelated;
}

/* snapshot of the previous scene, faded out when the theme or seed changes */
#fade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

.toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
}

#panel {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 2;
  width: 268px;
  max-height: calc(100% - 64px);
  overflow-y: auto;
  padding: 10px 12px 8px;
  background: rgba(10, 12, 22, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#panel.collapsed { display: none; }

#panel header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
#panel h1 { margin: 0; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
#info { color: #8c93ab; font-size: 11px; }

section { padding: 6px 0 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
section:first-of-type { border-top: 0; }

.lbl { display: flex; justify-content: space-between; margin: 6px 0 2px; color: #aab1c8; }
.lbl output { color: #fff; }

input[type=range] { width: 100%; margin: 2px 0; accent-color: #ffb45a; }

.btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

button {
  font: inherit;
  color: #dfe3f0;
  background: #1d2236;
  border: 2px solid #343b58;
  padding: 3px 7px;
  cursor: pointer;
}
button:hover { background: #283050; }
button.on { background: #ffb45a; border-color: #ffd49a; color: #1a1206; }

.chk { display: flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer; }
.hint { margin: 6px 0 0; color: #6d7591; font-size: 10.5px; }

body.ui-hidden #panel,
body.ui-hidden .toggle { display: none; }
body.ui-hidden { cursor: none; }

#error {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  font-size: 16px;
  text-align: center;
}
#error[hidden] { display: none; }

/* Advanced settings: collapsed by default */
#advanced { border-top: 1px solid rgba(255, 255, 255, 0.08); }
#advanced summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 0;
  color: #aab1c8;
  user-select: none;
}
#advanced summary::-webkit-details-marker { display: none; }
#advanced summary::before { content: '▸'; display: inline-block; width: 1.2em; color: #ffb45a; }
#advanced[open] summary::before { content: '▾'; }
#advanced summary:hover { color: #fff; }
#advanced section:first-of-type { border-top: 0; padding-top: 0; }
.actions { border-top: 1px solid rgba(255, 255, 255, 0.08); }
