/* ─────────────────────────────────────────────────────────────
   Meme Studio — Stacked / hamburger layout
   Header → Canvas → Controls strip → Download toolbar
   ───────────────────────────────────────────────────────────── */

/* ── Wrapper ─────────────────────────────────────────────────── */
#meme-generator-wrap {
  max-width: 1060px;
  margin: 0 auto 48px;
  background: #fff;
  border: 1px solid #e4e4e2;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #111;
  line-height: 1.4;
}

/* ── Header ──────────────────────────────────────────────────── */
.mg-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid #e4e4e2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.mg-title {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #111;
}
.mg-subtitle {
  margin: 0;
  font-size: 11px;
  color: #b0b0ae;
  letter-spacing: 1px;
}

/* ── Canvas area — full width ────────────────────────────────── */
.mg-canvas-area {
  background: #f2f2f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 14px;
  gap: 12px;
  border-bottom: 1px solid #e4e4e2;
}

.mg-canvas-wrapper {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.07),
    0 4px 16px rgba(0,0,0,0.09),
    0 0 0 1px rgba(0,0,0,0.05);
}
.mg-canvas-wrapper .canvas-container { display: block !important; }

/* ── Drop zone ───────────────────────────────────────────────── */
.mg-drop-zone {
  position: absolute;
  inset: 0;
  background: rgba(246,246,244,0.94);
  border: 1.5px dashed #c8c8c4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: background 0.18s, border-color 0.18s;
  text-align: center;
  padding: 24px;
}
.mg-drop-zone:hover,
.mg-drop-zone.drag-over {
  background: rgba(240,240,238,0.97);
  border-color: #555;
}
.mg-drop-icon {
  display: block;
  color: #c0c0be;
  margin-bottom: 16px;
  transition: color 0.18s;
}
.mg-drop-zone:hover .mg-drop-icon,
.mg-drop-zone.drag-over .mg-drop-icon { color: #555; }
.mg-drop-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: #333; letter-spacing: 0.3px; }
.mg-drop-sub   { font-size: 12px; margin: 0; color: #aaa; }

.mg-hint {
  font-size: 11px;
  color: #c0c0be;
  letter-spacing: 0.3px;
  text-align: center;
  margin: 0;
}

/* ── Controls strip — horizontal ────────────────────────────── */
.mg-controls {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #e4e4e2;
  min-height: 60px;
  overflow: hidden;
}

/* Vertical rule between sections */
.mg-vr {
  width: 1px;
  background: #e4e4e2;
  flex-shrink: 0;
  align-self: stretch;
}

/* ── Section columns ─────────────────────────────────────────── */
.mg-section {
  padding: 16px 20px;
  flex-shrink: 0;
}
.mg-section--photo    { flex: 0 0 200px; }
.mg-section--text     { flex: 1 0 230px; }
.mg-section--stickers { flex: 0 0 220px; }

.mg-label {
  display: block;
  margin: 0 0 11px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #b0b0ae;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.mg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  margin-bottom: 7px;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
  line-height: 1;
  white-space: nowrap;
}
.mg-btn:last-child { margin-bottom: 0; }
.mg-btn svg { flex-shrink: 0; }

.mg-btn--black  { background: #111; color: #fff; border-color: #111; }
.mg-btn--black:hover { background: #2d2d2d; border-color: #2d2d2d; }

.mg-btn--outline { background: #fff; color: #333; border-color: #d4d4d2; }
.mg-btn--outline:hover { border-color: #888; color: #111; }

.mg-btn--red { background: #fff; color: #bf3b30; border-color: #edc5c0; }
.mg-btn--red:hover { background: #fdf3f2; border-color: #d08880; }

.mg-btn--download {
  width: auto;
  margin-bottom: 0;
  padding: 11px 32px;
  letter-spacing: 1px;
}

/* ── Form fields ─────────────────────────────────────────────── */
.mg-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  gap: 8px;
  min-height: 26px;
}
.mg-field-label { font-size: 11px; color: #999; flex-shrink: 0; min-width: 50px; }

/* Color swatch — circle */
.mg-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #dedad8;
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.mg-swatch:hover { border-color: #666; }
.mg-swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.mg-swatch::-webkit-color-swatch         { border: none; border-radius: 50%; }
.mg-swatch::-moz-color-swatch            { border: none; border-radius: 50%; }

/* Range */
.mg-range-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.mg-range { width: 90px; accent-color: #111; cursor: pointer; }
.mg-range-val { font-size: 11px; color: #999; min-width: 20px; text-align: right; }

/* Select */
.mg-select {
  background: #fff;
  border: 1px solid #d4d4d2;
  border-radius: 2px;
  padding: 5px 7px;
  font-size: 11px;
  color: #333;
  cursor: pointer;
  outline: none;
  max-width: 120px;
}
.mg-select:focus { border-color: #888; }


/* ── Stickers — horizontal row ───────────────────────────────── */
.mg-stickers-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.mg-sticker-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid #e0e0de;
  background: #fafaf8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  transition: border-color 0.13s, background 0.13s;
}
.mg-sticker-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Footer toolbar ──────────────────────────────────────────── */
.mg-toolbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  background: #fafaf8;
  flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mg-controls    { flex-direction: column; }
  .mg-vr          { width: auto; height: 1px; align-self: auto; }
  .mg-steps       { display: none; }
  .mg-toolbar-tip { display: none; }
}
