html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, "Segoe UI", sans-serif;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

body.show #ui { cursor: none; }

#hint {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  color: #777;
  font-size: 16px;
  pointer-events: none;
}
body:not(.edit) #hint { display: none; }

#panel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 290px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 12px 14px;
  box-sizing: border-box;
  background: rgba(22, 22, 26, 0.94);
  border: 1px solid #333;
  border-radius: 8px;
  color: #ddd;
  font-size: 13px;
}
#panel.hidden { display: none; }
#panel.left { right: auto; left: 12px; }

/* mentre si trascina una forma il pannello quasi sparisce e lascia passare il mouse */
#panel { transition: opacity 0.15s; }
body.dragging #panel { opacity: 0.12; pointer-events: none; }

#panel .header { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
#panel h1 { margin: 0; font-size: 18px; color: #fff; flex: 1; }

#panelTab {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  background: rgba(22, 22, 26, 0.85);
  color: #ddd;
  border: 1px solid #444;
  border-radius: 6px;
  font: 13px system-ui, "Segoe UI", sans-serif;
  cursor: pointer;
}
#panelTab.left { right: auto; left: 12px; }
#panelTab[hidden] { display: none; }
body.dragging #panelTab { pointer-events: none; opacity: 0.3; }
#panel h2 {
  margin: 14px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8aa4c8;
}

#panel label { display: block; margin: 6px 0; }
#panel label.inline { display: flex; align-items: center; gap: 8px; }
#panel .checks:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; }
#panel input[type=range] { width: 100%; display: block; margin-top: 2px; }
#panel .val { float: right; color: #fff; font-variant-numeric: tabular-nums; }

#panel select, #panel button {
  background: #2c2c33;
  color: #eee;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}
#panel button { cursor: pointer; }
#panel button:hover { background: #3a3a44; }
#panel .buttons { display: flex; flex-wrap: wrap; gap: 6px; }

#panel .help p { margin: 0; line-height: 1.6; color: #aaa; }
#panel .help b { color: #ddd; font-weight: 600; }
