.generator-body {
  margin: 0;
  min-height: 100vh;
}

.generator-layout {
  width: min(1320px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
}

.generator-controls {
  border: 1px solid #3f4d63;
  background: rgba(16, 24, 35, 0.96);
  border-radius: 1rem;
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.generator-controls h1 {
  margin: 0.5rem 0 0.6rem;
  font-size: 1.85rem;
}

.generator-controls p {
  margin: 0 0 1rem;
  color: #c7d1db;
}

.back-link {
  width: fit-content;
}

.control-label {
  display: block;
  margin: 0.8rem 0 0.35rem;
  color: #d8e1eb;
  font-weight: 600;
}

.control-input {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid #4a5f7a;
  background: #1a2635;
  color: #ebf1f7;
  padding: 0.68rem 0.75rem;
  font: inherit;
}

input[type='range'] {
  width: 100%;
}

.control-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.generator-controls > .control-actions:first-child {
  margin-top: 0;
}

.generator-canvas-wrap {
  border: 1px solid #3f4d63;
  border-radius: 1rem;
  background: rgba(16, 24, 35, 0.8);
  padding: 1rem;
}

.canvas-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid #4a5871;
  background: #0a0f16;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.35);
}

#memeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#memeCanvas.dragging {
  cursor: grabbing;
}

.canvas-help {
  margin: 0.7rem 0 0;
  color: #bcc8d4;
}

@media (max-width: 1080px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }

  .generator-controls {
    position: static;
    max-height: none;
  }
}
