/* Achievement + Rank Badge makers. #mpm-scoped — tool-theme.css loads after this. */

#mpm { display: block; }

#mpm .mpm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
#mpm .mpm-tab { padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }

#mpm .mpm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
}
#mpm .mpm-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

#mpm .mpm-field { display: block; min-width: 0; }
#mpm .mpm-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .72;
  margin-bottom: 6px;
}
#mpm .mpm-hint { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.5; opacity: .68; }
#mpm input[type="text"] { width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; }

#mpm .mpm-colorrow { display: flex; align-items: center; gap: 8px; }
#mpm .mpm-colorrow input[type="color"] { width: 40px; height: 34px; padding: 0; border-radius: 8px; cursor: pointer; }
#mpm .mpm-hexin {
  width: 96px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px !important;
}

#mpm .mpm-segs { display: flex; flex-wrap: wrap; gap: 6px; }
#mpm .mpm-seg { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
#mpm .mpm-bgtoggle { margin-top: 8px; }

#mpm .mpm-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#mpm .mpm-preset {
  padding: 6px 12px;
  border-radius: 8px;
  border: 2px solid;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Stage ------------------------------------------------------------------ */
#mpm .mpm-stage {
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  overflow-x: auto;
}
/* A transparent PNG has to be shown against something, and a checkerboard is the only
 * background that does not imply a colour the file does not have. */
#mpm .mpm-bg-checker {
  background-image:
    linear-gradient(45deg, rgba(127, 127, 127, .22) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(127, 127, 127, .22) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(127, 127, 127, .22) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(127, 127, 127, .22) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
#mpm .mpm-bg-dark { background: #14181c; }
#mpm .mpm-bg-light { background: #f4f6f8; }

#mpm .mpm-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  /* Pixel art: the browser must not interpolate the preview, or a 1× image reads as blurry
   * and the reader assumes the download will be too. */
  image-rendering: pixelated;
}

#mpm .mpm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mpm .mpm-btn { padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
#mpm .mpm-note { margin: 14px 0 0; min-height: 1.2em; font-size: 13px; opacity: .85; }

#mpm .mpm-help { margin-top: 24px; font-size: 14.5px; line-height: 1.65; max-width: 72ch; }
#mpm .mpm-help p { margin: 0; }

#mpm [hidden] { display: none !important; }
