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

body {
  background: #0a0a0a;
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: "Courier New", monospace;
  color: #dcdcdc;
}

#canvasWrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 15% 15%, #1a1a1a 0%, #0a0a0a 55%, #050505 100%);
}

canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  border: 1px solid #202020;
}

#controls {
  width: 290px;
  min-width: 290px;
  background: #111;
  border-left: 1px solid #222;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior: contain;
}

#controls h1 {
  font-size: 12px;
  letter-spacing: 0.23em;
  text-transform: uppercase;
  color: #666;
  padding-bottom: 10px;
  border-bottom: 1px solid #222;
}

#mobileToggle {
  display: none;
  position: fixed;
  z-index: 20;
  right: 12px;
  top: 12px;
  border: 1px solid #2a2a2a;
  background: rgba(17, 17, 17, 0.92);
  color: #dcdcdc;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 2px;
}

#ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4a4a4a;
  margin-top: 2px;
}

.ctrl {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ctrl label {
  font-size: 10px;
  color: #707070;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.val {
  font-size: 10px;
  color: #535353;
  min-width: 38px;
  text-align: right;
}

.ctrl input[type="text"],
.ctrl textarea,
.ctrl input[type="number"] {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ddd;
  padding: 7px 8px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  outline: none;
}

.ctrl textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.35;
}

.ctrl input[type="text"]:focus,
.ctrl textarea:focus {
  border-color: #555;
}

.ctrl input[type="range"] {
  width: 100%;
  accent-color: #e0e0e0;
  height: 2px;
  background: #222;
  border: none;
  outline: none;
  cursor: pointer;
}

.ctrl input[type="color"] {
  width: 34px;
  height: 26px;
  border: 1px solid #2a2a2a;
  background: none;
  cursor: pointer;
  padding: 2px;
}

.ctrl input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.divider {
  border: 0;
  border-top: 1px solid #1e1e1e;
}

.save-btn {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ddd;
  padding: 8px 12px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.save-btn:hover {
  background: #242424;
  border-color: #3a3a3a;
}

.save-btn:active {
  background: #1a1a1a;
  border-color: #555;
}

@media (max-width: 980px) {
  #mobileToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #controls {
    position: fixed;
    z-index: 15;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    max-height: 72dvh;
    border-left: 0;
    border-top: 1px solid #222;
    transform: translateY(calc(100% - 52px));
    transition: transform 0.24s ease;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    padding-top: 12px;
  }

  body.controls-open #controls {
    transform: translateY(0);
  }

  body.controls-open #mobileToggle {
    background: rgba(35, 35, 35, 0.95);
  }

  #controls h1 {
    font-size: 11px;
    position: sticky;
    top: 0;
    background: #111;
    padding-top: 4px;
  }

  .ctrl label,
  .val {
    font-size: 11px;
  }

  .ctrl input[type="range"] {
    height: 4px;
  }

  .ctrl input[type="text"],
  .ctrl textarea,
  .ctrl input[type="number"] {
    font-size: 13px;
    padding: 10px 10px;
  }

  .save-btn {
    font-size: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }
}
