/* --- GENERAL --- */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial;
  margin: 16px;
  background: #f6f7fb;
  color: #111;
  overflow-x: hidden;
}

h1 {
  font-size: 20px;
  margin-bottom: 8px;
  text-align: center;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

.panel {
  background: white;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(20, 30, 60, 0.08);
  width: 100%;
  box-sizing: border-box;
}

/* --- CONTROLES --- */
.controls {
  width: 100%;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

/* Oculto por defecto en TODAS las pantallas */
#controlsContent {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

/* Visible al expandir */
.controls.expanded #controlsContent {
  max-height: 600px;
  opacity: 1;
}

#controlsContent {
  margin-top: 8px;
}

.toggle-btn {
  width: 100%;
  background: #2b7cff;
  color: white;
  border: none;
  padding: 10px
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
}

button {
  flex: 1 1 45%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #2b7cff;
  color: white;
  font-weight: 600;
  min-width: 100px;
}

label {
  font-size: 13px;
  flex: 1 1 100%;
}

input[type="range"],
input[type="color"] {
  flex: 1 1 100%;
  min-width: 0;
}

.tips {
  font-size: 12px;
  color: #556;
  margin-top: 8px;
}

/* --- CANVAS --- */
#canvasWrap {
  position: relative;
  padding: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  width: 100%;
  height: auto;
  border: 1px dashed rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  touch-action: none;
  background: transparent;
  max-width: 100%;
}

/* --- 🌟 RESPONSIVE --- */
@media (max-width: 768px) {
  h1 {
    font-size: 18px;
  }

  button {
    flex: 1 1 100%;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  body {
    margin: 8px;
  }

  .panel {
    padding: 10px;
  }

  .app {
    gap: 12px;
  }

  button {
    font-size: 14px;
    padding: 8px;
  }

  label {
    font-size: 12px;
  }

  .toggle-btn {
    font-size: 14px;
  }
}
