
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { background: #111; overflow: hidden; }
  canvas { display: block; }
  #overlay {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #555; font: 20px monospace; pointer-events: none; user-select: none;
    transition: color 0.3s;
  }
  body.dragging #overlay { color: #aaa; }
  #controls {
    position: fixed; bottom: 16px; left: 16px;
    display: flex; flex-direction: column; gap: 8px;
    color: #ccc; font: 15px monospace;
  }
  .row { display: flex; align-items: center; gap: 8px; }
  input[type=range] { width: 160px; accent-color: #888; }
  #info {
    position: fixed; top: 16px; left: 16px;
    color: #555; font: 13px monospace;
  }
  #fps {
    position: fixed; top: 36px; left: 16px;
    color: #8f8; font: 13px monospace;
  }
  .modeBtn {
    padding: 7px 20px;
    background: #222; color: #888;
    border: 1px solid #444; border-radius: 5px;
    font: 15px monospace; cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .modeBtn.active { background: #444; color: #eee; border-color: #aaa; }
  #slicePanel {
    position: fixed; bottom: 16px; right: 16px;
    display: flex; flex-direction: column; gap: 10px;
    color: #ccc; font: 15px monospace;
    background: #1a1a1a; border: 1px solid #333;
    border-radius: 8px; padding: 14px 18px;
    min-width: 280px;
  }
  #slicePanel .section-title {
    color: #aaa; font-size: 13px; letter-spacing: 1px;
    border-bottom: 1px solid #333; padding-bottom: 6px; margin-bottom: 2px;
  }
  .toggle-row { display: flex; align-items: center; gap: 10px; }
  .toggle-row label { cursor: pointer; user-select: none; }
  input[type=checkbox] { width: 18px; height: 18px; accent-color: #888; cursor: pointer; }
  .btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
  .smBtn {
    padding: 5px 12px;
    background: #222; color: #777;
    border: 1px solid #444; border-radius: 4px;
    font: 14px monospace; cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .smBtn.active { background: #3a3a3a; color: #ddd; border-color: #888; }
  #renderModeBar {
    position: fixed; top: 16px; right: 16px;
    display: flex; gap: 8px;
  }
  #maskPanel {
    position: fixed; top: 60px; right: 16px;
    display: flex; flex-direction: column; gap: 8px;
    color: #ccc; font: 15px monospace;
    background: #1a1a1a; border: 1px solid #333;
    border-radius: 8px; padding: 14px 18px;
    min-width: 200px;
  }
  #maskPanel .section-title {
    color: #aaa; font-size: 13px; letter-spacing: 1px;
    border-bottom: 1px solid #333; padding-bottom: 6px; margin-bottom: 2px;
  }
  .maskBtn {
    padding: 8px 14px;
    background: #222; color: #aaa;
    border: 1px solid #555; border-radius: 5px;
    font: 15px monospace; cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .maskBtn:hover { background: #333; color: #eee; }
  .maskBtn:active { background: #444; }
  #bakeStatus {
    position: fixed; top: 56px; left: 16px;
    color: #fa8; font: 13px monospace;
  }
</style>