/* MoonTik — Galerie d'overlays + Classement Cadeaux */
.ovlib { display: flex; flex-direction: column; gap: 16px; height: 100%; min-height: 0; }
.ovlib-head { display: flex; align-items: flex-start; gap: 12px; }
.ovlib-head .ic { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #3b2a78, #1e1b4b); display: grid; place-items: center; font-size: 20px; flex: none; }
.ovlib-head h2 { margin: 0; font-size: 20px; }
.ovlib-head p { margin: 4px 0 0; color: var(--muted, #9a9aa6); font-size: 13px; }
.ovlib-head .sp { flex: 1; }
.ovlib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ovlib-search { flex: 1; min-width: 180px; max-width: 420px; }
.ovlib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ovlib-chips button {
  background: #16161c; border: 1px solid #2a2a32; color: #c8c8d0; border-radius: 999px;
  padding: 5px 11px; font: 600 12px inherit; cursor: pointer;
}
.ovlib-chips button .n { margin-left: 6px; color: #8b8b96; }
.ovlib-chips button.on { background: #2e2158; border-color: #a78bfa; color: #f3e8ff; }
.ovlib-chips button.on .n { color: #c4b5fd; }
.ovlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.ovlib-card { background: #111114; border: 1px solid #26262c; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.ovlib-card:hover { border-color: #3a3a44; }
.ovlib-card.is-off { opacity: .7; }
.ovlib-prev { position: relative; height: auto; aspect-ratio: 4 / 3; min-height: 220px; background-color: #17171b;
  background-image: linear-gradient(45deg, #1f1f24 25%, transparent 25%), linear-gradient(-45deg, #1f1f24 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1f1f24 75%), linear-gradient(-45deg, transparent 75%, #1f1f24 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; overflow: hidden; }
.ovlib-prev iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform: none; transform-origin: 0 0; pointer-events: none; background: transparent; }
.ovlib-badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; z-index: 1; pointer-events: none; }
.ovlib-badge { font: 700 10px/1.2 inherit; letter-spacing: .03em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(15,15,20,.82); color: #ddd; border: 1px solid rgba(255,255,255,.12); }
.ovlib-badge.on { color: #86efac; border-color: rgba(74,222,128,.4); }
.ovlib-badge.off { color: #a1a1aa; }
.ovlib-badge.scene { color: #c4b5fd; border-color: rgba(167,139,250,.35); }
.ovlib-foot { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.ovlib-foot b { font-size: 14px; }
.ovlib-url { display: flex; gap: 6px; align-items: center; }
.ovlib-url input { flex: 1; min-width: 0; font-size: 11px; }
.ovlib-empty { text-align: center; padding: 56px 20px; color: var(--muted, #9a9aa6); border: 1px dashed #2a2a32; border-radius: 16px; }
.ovlib-empty h3 { margin: 8px 0 6px; color: #f4f4f8; }

/* Classement Cadeaux layout */
.glb { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.glb-left, .glb-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.glb-box { background: #121216; border: 1px solid #26262c; border-radius: 14px; padding: 12px; }
.glb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.glb-seg { display: inline-flex; background: #0e0e14; border: 1px solid #2a2a32; border-radius: 999px; padding: 3px; gap: 2px; }
.glb-seg button, .glb-chip {
  background: none; border: 0; color: #b0b0ba; border-radius: 999px; padding: 5px 11px; font: 600 12px inherit; cursor: pointer;
}
.glb-seg button.on, .glb-chip.on { background: #2e2158; color: #f3e8ff; }
.glb-prev { height: 320px; border-radius: 12px; overflow: hidden; position: relative;
  background-color: #17171b;
  background-image: linear-gradient(45deg, #1f1f24 25%, transparent 25%), linear-gradient(-45deg, #1f1f24 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1f1f24 75%), linear-gradient(-45deg, transparent 75%, #1f1f24 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.glb-prev iframe { width: 100%; height: 100%; border: 0; background: transparent; }
.glb-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.glb-item { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; text-align: left; color: inherit; font: inherit; padding: 10px 12px; background: #16161c; border: 1px solid #2a2a32; border-radius: 12px; cursor: pointer; }
.glb-item.on { border-color: #a78bfa; background: #1a1630; }
.glb-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #0e0e14; }
.glb-item b { display: block; }
.glb-item .meta { color: #9a9aa6; font-size: 12px; }
@media (max-width: 960px) { .glb { grid-template-columns: 1fr; } }

/* t115 */
.ovlib-card { border-radius: 16px; }
.ovlib-card:hover { border-color: color-mix(in srgb, var(--mt-a, #c4b5fd) 55%, #3a3a44); box-shadow: 0 10px 24px rgba(0,0,0,.28), 0 0 16px color-mix(in srgb, var(--mt-a, #c4b5fd) 18%, transparent); }
.ovlib-head .ic {
  background: linear-gradient(145deg, color-mix(in srgb, var(--mt-a, #c4b5fd) 50%, #3b2a78), #1e1b4b);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mt-a, #c4b5fd) 35%, transparent);
}


/* t115c — card-sized iframes fill the preview; no 1920×1080 lock */
.ovlib-prev.mt-fit-wrap > .mt-fit-inner:has(iframe),
.mtbe-prev.mt-fit-wrap > .mt-fit-inner:has(iframe),
.ovlib-prev > .mt-fit-inner,
.mtbe-prev > .mt-fit-inner,
.ovlib-prev .ov-ifr-prev,
.mtbe-prev .ov-ifr-prev {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  will-change: auto !important;
}
.ovlib-prev iframe,
.mtbe-prev iframe,
.ovlib-prev .ov-ifr-prev iframe,
.mtbe-prev .ov-ifr-prev iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  transform: none !important;
}

/* t168 — panneau Configuration : lignes message compactes + jetons en pilules.
   Cause : .glb-row wrapping + min-width:auto sur .input (↑ seul sur la 1re ligne,
   ↓ ✕ passent en dessous) ; .glb-chip était un bouton de segment nu
   (background:none; border:0) donc les inserteurs de variables ressemblaient
   à de simples liens texte. On ne touche pas à .glb-seg button. */
.glb-row:has(> .input) {
  flex-wrap: nowrap;
  min-width: 0;
}
.glb-row > .input,
.ov-perso-fields .glb-row > .input,
.ov-score-section .glb-row > .input,
.field-row:has(> .icon-btn) > .input {
  min-width: 0;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
}
.glb-row > .icon-btn,
.ov-perso-fields .glb-row > .icon-btn,
.field-row:has(> .input) > .icon-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border, #2a2a32);
  background: var(--bg-row, #16161c);
  color: var(--text, #f4f4f8);
  border-radius: 8px;
}
.ov-perso-fields .field-row:has(> .input):has(> .icon-btn) {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Jetons / tokens : pilules du design system (comme .bd-live-chip), pas du texte nu. */
button.glb-chip,
.glb-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg-row, #16161c);
  border: 1px solid var(--border-soft, #2a2a32);
  color: var(--text, #e8e6f2);
  border-radius: 999px;
  padding: 5px 11px;
  font: 600 11px inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.glb-chip:hover {
  border-color: var(--accent, #a78bfa);
  background: color-mix(in srgb, var(--accent, #a78bfa) 14%, #16161c);
  color: #f3e8ff;
}
.glb-seg button.on,
.glb-chip.on {
  background: #2e2158;
  color: #f3e8ff;
  border-color: #a78bfa;
}
