/* MoonTik — sélecteur de couleur partagé */
.mtc-swatch {
  width: 28px; height: 22px; border-radius: 6px; padding: 0; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
  background:
    linear-gradient(var(--mtc, #a78bfa), var(--mtc, #a78bfa)),
    repeating-conic-gradient(#3a3a44 0% 25%, #1c1c22 0% 50%) 0 0 / 8px 8px;
  flex-shrink: 0; vertical-align: middle;
}
.mtc-swatch:hover { border-color: #c4b5fd; }
.mtc-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.mtc-pop {
  position: fixed; z-index: 10050; width: 248px; padding: 10px;
  background: #16161c; border: 1px solid #2e2e38; border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(167,139,250,.12);
  color: #e8e8ef; font: 12px/1.3 Inter, Segoe UI, sans-serif;
}
.mtc-sv {
  position: relative; width: 100%; height: 140px; border-radius: 8px; overflow: hidden; cursor: crosshair;
  background: linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, var(--hue, #ff0000));
}
.mtc-sv i, .mtc-hue i, .mtc-alpha i {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.4);
  transform: translate(-50%, -50%); pointer-events: none; background: var(--handle, #fff);
}
.mtc-hue, .mtc-alpha { position: relative; height: 14px; margin-top: 10px; border-radius: 99px; cursor: pointer; }
.mtc-hue {
  background: linear-gradient(to right, #ff0040, #ffcc00, #00ff66, #00ccff, #6600ff, #ff00cc, #ff0040);
}
.mtc-hue i, .mtc-alpha i { top: 50%; width: 16px; height: 16px; }
.mtc-alpha { background:
  linear-gradient(to right, var(--solid, #ff0050), transparent),
  repeating-conic-gradient(#3a3a44 0% 25%, #1c1c22 0% 50%) 0 0 / 10px 10px;
}
.mtc-cap { display: flex; justify-content: space-between; margin-top: 10px; color: #b7b7c4; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.mtc-cap b { color: #f6d98a; }
.mtc-pal { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-top: 10px; }
.mtc-pal button { aspect-ratio: 1; border-radius: 5px; border: 1px solid rgba(255,255,255,.22); padding: 0; cursor: pointer; background: var(--c); }
.mtc-pal button.on { outline: 2px solid #fff; outline-offset: 1px; }
.mtc-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.mtc-hash { color: #9a9aa6; font-weight: 700; }
.mtc-hex {
  flex: 1; min-width: 0; background: #0e0e14; border: 1px solid #2e2e38; border-radius: 8px;
  color: #f4f4f8; font: 600 12px/1 ui-monospace, Cascadia Code, monospace;
  padding: 7px 8px; text-transform: uppercase;
}
.mtc-hex:focus { outline: none; border-color: #a78bfa; }
.mtc-drop {
  width: 34px; height: 32px; border-radius: 8px; border: 1px solid #2e2e38; background: #0e0e14;
  color: #e8e8ef; cursor: pointer; display: grid; place-items: center;
}
.mtc-drop:hover { border-color: #a78bfa; color: #c4b5fd; }
.mtc-drop svg { width: 16px; height: 16px; }


/* Pastille désactivée (couleur automatique) : ne pas afficher une teinte trompeuse. */
.mtc-swatch.is-disabled,
.mtc-swatch:disabled {
  cursor: not-allowed;
  filter: grayscale(.85);
  opacity: .7;
  --mtc: transparent;
  position: relative;
}
.mtc-swatch.is-disabled:hover,
.mtc-swatch:disabled:hover { border-color: rgba(255,255,255,.18); }
.mtc-swatch.is-disabled::after,
.mtc-swatch:disabled::after {
  content: attr(data-auto);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 7px/1 Inter, Segoe UI, sans-serif;
  letter-spacing: .04em;
  color: #c4b5fd;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

/* Aperçu éditeur (ha) : chiffres forcés */
.ov-live-preview[data-num-custom="1"] em,
.ov-live-preview[data-num-custom="1"] .ov-cm-bubble em,
.ov-live-preview[data-num-custom="1"] [data-pv-num="1"],
.ov-live-preview[data-num-custom="1"] [data-pv-num="1"] * {
  color: var(--pv-num-color) !important;
  -webkit-text-fill-color: var(--pv-num-color) !important;
}

/* Orientation du dégradé — grille 3x3 */
.mtg-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0);
}
.mtg-grid {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: repeat(3, 40px);
  gap: 6px;
  width: fit-content;
  padding: 8px;
  margin-top: 6px;
  border-radius: 14px;
  background: #1b1736;
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.08);
}
.mtg-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #100e22;
  color: #c4b5fd;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.mtg-btn:hover { border-color: #a78bfa; color: #fff; background: #1a1030; }
.mtg-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}
.mtg-btn.is-on {
  background: linear-gradient(135deg, #c4b5fd 0%, #38bdf8 100%);
  color: #0b0a18;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35), 0 0 12px rgba(56, 189, 248, 0.25);
  font-weight: 800;
}
.mtg-preview {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
  background:
    linear-gradient(160deg, #1e1b4b, #0c1224),
    repeating-conic-gradient(#3a3a44 0% 25%, #1c1c22 0% 50%) 0 0 / 8px 8px;
}
.mtg-preview.is-transparent {
  background: repeating-conic-gradient(#3a3a44 0% 25%, #1c1c22 0% 50%) 0 0 / 8px 8px;
}
