/* Base emoji size */
.h5p-content .h5p-emoji {
  font-size: 2.25em !important;
  line-height: 1 !important;
}

/* Drag the words dropzone */
.h5p-content .h5p-drag-text .h5p-dropzone {
  position: relative !important;
  overflow: visible !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
}

/* =========================
   MIXED: text + emoji
   Example: חיות 🐱 🐶
========================= */

/*
  Important:
  Do NOT override the source-tray draggable box.
  Let H5P keep the same padding, margin, display, line-height, and handle spacing
  as normal text-only draggables.
*/

/* Only control emojis inside source-bank mixed draggables */
.h5p-content .h5p-draggable.h5p-emoji-mixed:not(.h5p-draggable--dropped):not(.h5p-draggable-correct):not(.h5p-draggable-wrong):not(.ui-draggable-disabled) .h5p-emoji {
  display: inline-block !important;
  font-size: 1.08em !important;
  line-height: 1 !important;

  padding: 0 !important;
  margin: 0 2px !important;

  position: relative !important;
  top: -1px !important;
}


/* Dropped mixed cards: more like normal text-only draggable */
.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-mixed {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;

  width: auto !important;
  min-width: 78px !important;
  max-width: 115px !important;

  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;

  padding: 5px 10px !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  white-space: nowrap !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Dropped inner line */
.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-mixed > span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;

  padding: 0 !important;
  margin: 0 !important;

  line-height: 1 !important;
  overflow: visible !important;
}

/* Dropped emojis: tiny, close to text */
.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-mixed .h5p-emoji {
  display: inline-block !important;
  font-size: 0.85em !important;
  line-height: 1 !important;

  padding: 0 !important;
  margin: 0 1px !important;

  position: relative !important;
  top: -1px !important;

  transform: none !important;
}

/* =========================
   EMOJI ONLY
   Example: 🍺 / ☕ / 🍸
========================= */

.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-only {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;

  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;

  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  box-sizing: border-box !important;
  transform: translate(-50%, -50%) !important;
}

.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-only > span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-only::before,
.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-only > span::before {
  display: none !important;
  content: none !important;
}

.h5p-content .h5p-drag-text .h5p-dropzone .h5p-draggable--dropped.h5p-emoji-only .h5p-emoji {
  font-size: 1.7em !important;
  line-height: 1 !important;
  position: relative !important;
  top: -15px !important;
}

/*
  Drag Text RTL dropped-answer fix

  Scope:
  Only dropzones that already contain a dropped answer.
  Empty dropzones keep their original H5P size.
*/

/* Only expand inline dropzones after an answer is inside them */
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline:has(.h5p-draggable) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;

  overflow: visible !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* Only expand filled / checked droppable areas */
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable:has(> .h5p-draggable),
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable.h5p-dropzone-correct,
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable.h5p-dropzone-wrong {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;

  overflow: visible !important;
  white-space: nowrap !important;
}

/* Only dropped answers, not the draggable bank */
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable,
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable-correct,
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable-wrong {
  display: inline-flex !important;
  flex-direction: row-reverse !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.32em !important;

  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  overflow: visible !important;

  direction: rtl !important;
  unicode-bidi: isolate !important;
  box-sizing: border-box !important;
  line-height: 1.25 !important;
}

/* Keep the Hebrew text inside the dropped answer unbroken */
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable > span {
  display: inline-block !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  overflow: visible !important;

  direction: rtl !important;
  unicode-bidi: isolate !important;
  line-height: 1.25 !important;
}

.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable::before,
.h5p-drag-text .h5p-dropzone.h5p-dropzone--inline > .ui-droppable > .h5p-draggable::after {
  flex: 0 0 auto !important;
}

/* Safety: Drag and Drop / DragQuestion must keep absolute drop-zone positioning */
.h5p-content .h5p-dragquestion > .h5p-inner {
  position: relative !important;
}

.h5p-content .h5p-dragquestion .h5p-dropzone {
  position: absolute !important;
  box-sizing: border-box !important;
}