*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #1a1a2e;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

#canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 20, 40, 0.6);
  color: #99ccdd;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  border: 1px solid rgba(0, 180, 220, 0.25);
}

#panel {
  background: #0f1a28;
  border-top: 2px solid #0a3a50;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 115px;
  flex-shrink: 0;
}

#panel-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #88aacc;
}

.ctrl-row label { font-size: 13px; font-weight: 500; white-space: nowrap; }

.ctrl-row span { min-width: 32px; text-align: right; font-family: monospace; font-size: 12px; color: #aaccdd; }

.ctrl-row input[type=range] { cursor: pointer; accent-color: #00aacc; width: 90px; }

#add-btn {
  padding: 5px 14px;
  background: #005577;
  color: #aaeeff;
  border: 1px solid #007799;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
#add-btn:hover { background: #006688; color: #ccffff; }

#share-btn {
  padding: 5px 14px;
  background: #2a1a55;
  color: #bbaaff;
  border: 1px solid #5533aa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
#share-btn:hover { background: #3a2266; color: #ddccff; }

#share-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2a1a55;
  color: #ddccff;
  border: 1px solid #5533aa;
  border-radius: 20px;
  padding: 7px 20px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
#share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#lens-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

#lens-list::-webkit-scrollbar { height: 4px; }
#lens-list::-webkit-scrollbar-track { background: #0a1520; }
#lens-list::-webkit-scrollbar-thumb { background: #0a4060; border-radius: 2px; }

.lc {
  background: #0c1e30;
  border: 2px solid #1a3a50;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 190px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.lc:hover { border-color: #006688; }
.lc.sel { border-color: #00aacc; background: #0a2535; }

.lc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.lc-name { font-weight: bold; font-size: 13px; flex: 1; color: #aaccdd; }

.lc-type {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  font-weight: 500;
  background: none;
}
.lc-type:hover { filter: brightness(1.3); }
.lc-type.conv { border-color: #00aa66; color: #00dd88; }
.lc-type.div  { border-color: #cc4400; color: #ff6622; }

.lc-del {
  background: none;
  border: 1px solid #334455;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  color: #556677;
  line-height: 1;
}
.lc-del:hover { background: #2a0a0a; border-color: #aa3333; color: #dd4444; }

.lc-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lc-fval {
  font-size: 12px;
  color: #7799aa;
  font-family: monospace;
}

.lc-fslider { width: 100%; cursor: pointer; accent-color: #00aacc; }
