/* TeeLagoon Drawing Studio */
.ds-overlay {
  position: fixed; inset: 0; z-index: 50; background: #0f2e2b;
  display: none; flex-direction: column; font-family: 'Segoe UI', system-ui, sans-serif;
}
.ds-overlay.open { display: flex; }

.ds-topbar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .8rem; background: linear-gradient(120deg, #14b8a6, #22c55e);
}
.ds-title { font-weight: 800; color: #fff; margin-right: auto; }
.ds-title span { color: #facc15; }
.ds-btn {
  border: none; border-radius: 8px; padding: .45rem .8rem; font-weight: 700;
  font-size: .82rem; cursor: pointer; background: rgba(255,255,255,.18); color: #fff;
}
.ds-btn:hover { background: rgba(255,255,255,.32); }
.ds-btn:disabled { opacity: .4; cursor: not-allowed; }
.ds-btn.primary { background: #facc15; color: #134e4a; }
.ds-btn.primary:hover { background: #eab308; }
.ds-btn.danger { background: rgba(220,38,38,.85); }

.ds-body { flex: 1; display: flex; min-height: 0; }

.ds-tools {
  display: flex; flex-direction: column; gap: .35rem; padding: .6rem .45rem;
  background: #113c38; overflow-y: auto;
}
.ds-tool {
  width: 44px; height: 44px; border-radius: 10px; border: 2px solid transparent;
  background: #1c5a54; color: #ccfbf1; font-size: 1.15rem; cursor: pointer;
}
.ds-tool:hover { background: #14b8a6; }
.ds-tool.active { background: #14b8a6; border-color: #facc15; }

.ds-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: .8rem; position: relative;
}
.ds-stage {
  position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.5); border-radius: 4px;
  background:
    repeating-conic-gradient(#e8eceb 0% 25%, #ffffff 0% 50%) 0 0 / 24px 24px;
  touch-action: none;
}
.ds-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#dsPreview { pointer-events: none; }

.ds-panel {
  width: 240px; background: #113c38; color: #ccfbf1; padding: .8rem;
  overflow-y: auto; font-size: .82rem;
}
.ds-panel h4 {
  margin: .9rem 0 .4rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: 1px; color: #5eead4;
}
.ds-panel h4:first-child { margin-top: 0; }
.ds-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.ds-row label { flex: 1; font-weight: 600; }
.ds-row output { min-width: 2.5em; text-align: right; font-weight: 700; color: #facc15; }
.ds-row input[type=range] { flex: 2; accent-color: #facc15; }
.ds-row select, .ds-row input[type=text] {
  flex: 2; background: #1c5a54; color: #fff; border: none; border-radius: 6px; padding: .35rem .5rem;
}
.ds-row input[type=checkbox] { accent-color: #facc15; width: 16px; height: 16px; }

#dsColor { width: 100%; height: 40px; border: none; border-radius: 8px; background: none; cursor: pointer; }
.ds-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: .4rem; }
.ds-swatch {
  aspect-ratio: 1; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.25);
}
.ds-swatch:hover { transform: scale(1.15); }

.ds-brushes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ds-brush {
  padding: .4rem .3rem; border-radius: 8px; border: 2px solid transparent;
  background: #1c5a54; color: #ccfbf1; font-size: .74rem; font-weight: 700; cursor: pointer;
}
.ds-brush:hover { background: #14b8a6; }
.ds-brush.active { background: #14b8a6; border-color: #facc15; }

.ds-hint {
  position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%);
  color: rgba(204,251,241,.55); font-size: .72rem; white-space: nowrap; pointer-events: none;
}

@media (max-width: 760px) {
  .ds-body { flex-direction: column; }
  .ds-tools { flex-direction: row; order: 2; }
  .ds-panel { width: auto; order: 3; max-height: 32vh; }
  .ds-canvas-wrap { order: 1; }
}
