/* Module modules-jeux : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
/* Structure Tree View */
  .tree-node{
    position:relative;
    padding:4px 8px;
    margin:2px 0;
    border-radius:4px;
    cursor:pointer;
    user-select:none;
    transition:background 0.15s ease;
  }
  .tree-node:hover{
    background:#f0f0f0;
  }
  .tree-node.selected{
    background:#e3f2fd;
    border-left:3px solid #2196f3;
    padding-left:5px;
  }
  .tree-node.drag-over{
    background:#fff3cd;
    border:1px dashed #ffc107;
  }
  .tree-node-content{
    display:flex;
    align-items:center;
    gap:6px;
  }
  .tree-toggle{
    width:16px;
    height:16px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:10px;
    transition:transform 0.2s;
  }
  .tree-toggle.expanded{
    transform:rotate(90deg);
  }
  .tree-children{
    margin-left:18px;
    border-left:1px dotted #ddd;
    padding-left:6px;
  }
  .tree-children.collapsed{
    display:none;
  }
  .tree-tag{
    font-weight:600;
    color:#1976d2;
    font-family:monospace;
  }
  .tree-text{
    color:#666;
    font-style:italic;
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .tree-attrs{
    font-size:10px;
    color:#888;
    margin-left:4px;
  }
  .tree-icon{
    width:14px;
    height:14px;
    opacity:0.6;
  }
  .tree-actions{
    margin-left:auto;
    display:none;
    gap:4px;
  }
  .tree-node:hover .tree-actions{
    display:flex;
  }
  .tree-action-btn{
    width:20px;
    height:20px;
    padding:0;
    border:none;
    background:#fff;
    border-radius:3px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:background 0.15s;
  }
  .tree-action-btn:hover{
    background:#e0e0e0;
  }
  .tree-action-btn svg{
    width:12px;
    height:12px;
  }

/* Styles pour les boutons de couleur de flipcard */
.flipcard-color-btn {
  border: 2px solid transparent !important;
  transition: all 0.2s ease;
  padding: 0 !important;
}
.flipcard-color-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.flipcard-color-btn.active {
  border-color: var(--mv-text-heading) !important;
  box-shadow: 0 0 0 3px rgba(52, 71, 103, 0.3);
  transform: scale(1.1);
}
.flipcard-custom-color {
  cursor: pointer;
  transition: all 0.2s ease;
}
.flipcard-custom-color:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.flipcard-image-preview {
  transition: all 0.2s ease;
}
.flipcard-image-preview:hover {
  border-color: #6366f1 !important;
}

/* Game modules editor modals */
.game-module-modal .modal-dialog {
  max-width: 1140px;
}

.game-module-modal .modal-body {
  background: var(--mv-gray-50);
}

.game-module-modal .modal-header {
  border-bottom: 1px solid #e9edf5;
}

.game-module-modal .game-help-card {
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
  padding: 0.75rem 0.9rem;
}

.game-module-modal .game-help-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mv-primary-hover);
  margin-bottom: 0.35rem;
}

.game-module-modal .game-help-text {
  font-size: 0.84rem;
  color: #1f2937;
  line-height: 1.35;
}

.game-module-modal .game-help-steps {
  margin: 0;
  padding-left: 1rem;
  color: var(--mv-gray-700);
  font-size: 0.8rem;
  line-height: 1.35;
}

.game-module-modal .game-help-steps li + li {
  margin-top: 0.2rem;
}

.game-module-modal .game-media-input-group > .form-control,
.game-module-modal .game-media-input-group > .btn {
  min-height: calc(1.5em + 0.5rem + 2px);
}

.game-module-modal .game-media-input-group > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-module-modal .game-media-picker-btn {
  min-width: 88px;
  white-space: nowrap;
}

.game-module-modal .game-media-picker {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.game-module-modal .game-media-picker-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-module-modal .game-media-clear-btn {
  min-width: 84px;
  white-space: nowrap;
}

.game-module-modal .game-media-thumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  border: 1px solid #d7e3f2;
  border-radius: 0.6rem;
  background: #f8fbff;
  padding: 0.34rem 0.45rem;
}

.game-module-modal .game-media-thumb img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 0.45rem;
  border: 1px solid #c8d8ee;
  object-fit: cover;
  background: #ffffff;
}

.game-module-modal .game-media-thumb-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  color: var(--mv-gray-600);
}

.game-module-modal .game-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.game-module-modal .game-row {
  border: 1px solid #dbe4f0;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.75rem;
}

.game-module-modal .chronology-side-panel {
  top: 12px;
}

.game-module-modal .chronology-counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: var(--mv-gray-50);
  color: var(--mv-gray-600);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.game-module-modal .chronology-format-panel {
  padding: 0.85rem !important;
}

.game-module-modal .chronology-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.game-module-modal .chronology-format-control-wide {
  grid-column: 1 / -1;
}

.game-module-modal .chronology-format-control .form-label {
  color: var(--mv-text-heading);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
}

.game-module-modal .chronology-segmented {
  min-height: 30px;
}

.game-module-modal .chronology-segmented > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.26rem 0.48rem;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.game-module-modal .chronology-format-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.7rem;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mv-gray-200);
}

.game-module-modal .chronology-format-switch {
  display: flex;
  align-items: center;
  min-height: 24px;
  gap: 0.38rem;
  padding-left: 0;
}

.game-module-modal .chronology-format-switch .form-check-input {
  flex: 0 0 auto;
  width: 2rem;
  height: 1.05rem;
  margin: 0;
}

.game-module-modal .chronology-format-switch .form-check-label {
  overflow: hidden;
  color: var(--mv-gray-600);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-module-modal .chronology-title-color-control {
  border: 1px solid var(--mv-gray-200);
  border-radius: 0.75rem;
  background: #ffffff;
  margin-top: 0.5rem;
  padding: 0.7rem 0.85rem;
}

.game-module-modal .chronology-title-color-control .form-control-color {
  width: 2.35rem;
  height: 2.1rem;
  flex: 0 0 auto;
}

.game-module-modal .chronology-title-color-control .btn {
  min-height: 2.1rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.game-module-modal .chronology-title-color-control .chronology-segmented > .btn {
  min-height: 28px;
  padding: 0.24rem 0.42rem;
}

.game-module-modal #chronologyEventsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.55rem;
  max-height: 265px;
  overflow-y: auto;
  padding: 0.15rem 0.25rem 0.2rem 0;
}

.game-module-modal .chronology-active-editor {
  margin-top: 0.75rem;
}

.game-module-modal .chronology-editor-card {
  border: 1px solid #cfdafe;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(0, 85, 255, 0.1);
  padding: 0.85rem;
}

.game-module-modal .chronology-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.game-module-modal .chronology-event-card {
  padding: 0;
  overflow: hidden;
  border-color: #d7e3f2;
  background: #ffffff;
}

.game-module-modal .chronology-event-card.is-active {
  border-color: var(--mv-primary);
  box-shadow: 0 8px 22px rgba(0, 85, 255, 0.12);
}

.game-module-modal .chronology-event-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  min-height: 86px;
}

.game-module-modal .chronology-event-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--mv-gray-300);
  border-radius: 999px;
  background: var(--mv-gray-50);
  color: #1f2937;
  font-size: 0.78rem;
  font-weight: 800;
}

.game-module-modal .chronology-event-summary {
  min-width: 0;
  flex: 1 1 auto;
}

.game-module-modal .chronology-event-title {
  overflow: hidden;
  color: #1f2937;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-module-modal .chronology-event-meta {
  overflow: hidden;
  color: var(--mv-gray-500);
  font-size: 0.74rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-module-modal .chronology-event-actions {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0.28rem;
  justify-content: flex-start;
  padding-left: 39px;
}

.game-module-modal .chronology-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.52rem;
  text-transform: uppercase;
}

.game-module-modal .chronology-status.is-ready {
  background: #ecfdf3;
  color: #166534;
}

.game-module-modal .chronology-status.is-empty {
  background: var(--mv-gray-100);
  color: var(--mv-gray-500);
}

.game-module-modal .chronology-event-body {
  border-top: 1px solid var(--mv-gray-200);
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
  padding: 0.75rem;
}

.game-module-modal .chronology-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.game-module-modal .chronology-section-label {
  color: var(--mv-gray-600);
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 0.2rem;
}

.game-module-modal .chronology-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.game-module-modal .chronology-field-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #dbe4f0;
  border-radius: 0.65rem;
  background: #ffffff;
  color: var(--mv-gray-500);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 0.35rem;
  margin: 0;
  padding: 0.34rem 0.55rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.game-module-modal .chronology-field-chip input {
  margin: 0;
}

.game-module-modal .chronology-field-chip.is-on {
  border-color: var(--mv-primary);
  background: #eef2ff;
  color: #324cdd;
}

.game-module-modal .chronology-image-label {
  max-width: 180px;
  overflow: hidden;
  color: var(--mv-gray-500);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .game-module-modal .chronology-format-grid,
  .game-module-modal .chronology-format-switches {
    grid-template-columns: 1fr;
  }

  .game-module-modal .chronology-event-head {
    align-items: flex-start;
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .game-module-modal .chronology-event-actions {
    padding-left: 0;
    justify-content: flex-start;
  }

  .game-module-modal .chronology-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.game-module-modal .association-pair-row {
  border-color: #d1ddf1;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 0.65rem 0.7rem;
}

.game-module-modal .association-pair-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.game-module-modal .association-pair-index {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #c7d9fb;
  background: #e8f0ff;
  color: #1e3a8a;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.1;
  padding: 0.22rem 0.55rem;
}

.game-module-modal .association-pair-remove {
  white-space: nowrap;
}

.game-module-modal .association-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.game-module-modal .association-pair-item {
  border: 1px solid #d8e4f4;
  border-radius: 0.62rem;
  background: #ffffff;
  padding: 0.52rem 0.56rem;
  min-width: 0;
}

.game-module-modal .association-pair-item-label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--mv-gray-600);
}

.game-module-modal .association-pair-item .form-control {
  border-color: #cad8eb;
}

.game-module-modal .association-pair-item .form-control:focus {
  border-color: #8fb4f2;
  box-shadow: 0 0 0 0.14rem rgba(59, 130, 246, 0.16);
}

.game-module-modal .association-pair-media {
  margin-top: 0.42rem;
}

.game-module-modal .association-pair-media > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--mv-primary);
  line-height: 1.2;
}

.game-module-modal .association-pair-media > summary::-webkit-details-marker {
  display: none;
}

.game-module-modal .association-pair-media > summary::before {
  content: '+';
  width: 12px;
  display: inline-block;
  text-align: center;
  color: var(--mv-primary-hover);
  font-weight: 700;
}

.game-module-modal .association-pair-media[open] > summary::before {
  content: '-';
}

.game-module-modal .association-pair-media-body {
  margin-top: 0.36rem;
}

.game-module-modal .ws-remove-col {
  display: flex;
}

.game-module-modal .wordsearch-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.game-module-modal .wordsearch-remove-btn i {
  margin: 0 !important;
  line-height: 1;
}

.game-module-modal .ordering-row {
  border-color: #d3deed;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 0 0 1px rgba(219, 228, 240, 0.3);
}

.game-module-modal .ordering-row-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

.game-module-modal .ordering-row-index {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
  background: linear-gradient(135deg, #e0ecff 0%, #c8dbff 100%);
  border: 1px solid #b8cefa;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.12);
}

.game-module-modal .ordering-row-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.game-module-modal .ordering-row-field input {
  border-color: #cad8eb;
}

.game-module-modal .ordering-row-field input:focus {
  border-color: #8fb4f2;
  box-shadow: 0 0 0 0.14rem rgba(59, 130, 246, 0.16);
}

.game-module-modal .ordering-row-image {
  border: 1px solid #d6e1ef;
  border-radius: 0.65rem;
  padding: 0.5rem;
  background: #f8fbff;
}

.game-module-modal .ordering-row-image.has-image {
  border-color: #b9d0ec;
  background: #f2f8ff;
}

.game-module-modal .ordering-row-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-module-modal .ordering-row-image-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #4b5563;
}

.game-module-modal .ordering-row-image-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.game-module-modal .ordering-row-image-preview {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid #d0ddf0;
  background: #ffffff;
  min-width: 0;
}

.game-module-modal .ordering-row-image-preview img {
  width: 40px;
  height: 40px;
  border-radius: 0.45rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #d6e1ef;
}

.game-module-modal .ordering-row-image-name {
  font-size: 0.78rem;
  color: var(--mv-gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-module-modal .ordering-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-module-modal .ordering-action-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #cfdaeb;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.game-module-modal .ordering-action-btn:hover:not(:disabled) {
  border-color: #9ab8e6;
  color: var(--mv-primary-hover);
  background: var(--mv-primary-50);
  transform: translateY(-1px);
}

.game-module-modal .ordering-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-module-modal .ordering-action-btn.is-danger {
  color: #b91c1c;
  border-color: #efc5c5;
  background: #fff8f8;
}

.game-module-modal .ordering-action-btn.is-danger:hover:not(:disabled) {
  color: #ffffff;
  background: #dc2626;
  border-color: #dc2626;
}

.game-module-modal .game-preview-panel {
  border: 1px solid #dbe4f0;
  border-radius: 0.75rem;
  background: #ffffff;
  min-height: 320px;
  padding: 0.75rem;
  position: sticky;
  top: 0;
}

.game-module-modal .colorization-modal-layout {
  min-height: 520px;
}

.game-module-modal .colorization-options-panel {
  border: 1px solid var(--mv-gray-300);
  border-radius: 0.375rem;
  padding: 1rem;
}

.game-module-modal .colorization-preview-image {
  display: block;
  width: 100%;
  border: 1px solid var(--mv-gray-300);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.game-module-modal .colorization-preview-source {
  max-height: 220px;
}

.game-module-modal .colorization-preview-result {
  max-height: 260px;
}

.game-module-modal .google-review-editor-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.game-module-modal .google-review-field-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-module-modal .google-review-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  background: linear-gradient(180deg, var(--mv-gray-50) 0%, #eef4ff 100%);
}

.game-module-modal .google-review-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mv-gray-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.game-module-modal .google-review-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 0.75rem;
  border: 1px dashed var(--mv-gray-300);
  border-radius: 0.75rem;
  background: #ffffff;
}

.game-module-modal .google-review-preview-stage .tinymce-google-review-card {
  width: 100% !important;
  margin: 0 auto !important;
}

.game-module-modal .game-style-block {
  border: 1px solid #dbe4f0;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.85rem;
}

.game-module-modal .game-card-bg-picker {
  min-height: 34px;
}

.game-module-modal .game-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent !important;
  padding: 0 !important;
  transition: all 0.18s ease;
}

.game-module-modal .game-color-btn[data-color="primary"] {
  background: var(--mv-primary);
}

.game-module-modal .game-color-btn[data-color="gradient-blue"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-green"] {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-orange"] {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-sunset"] {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-ocean"] {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-purple"] {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-fire"] {
  background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
}

.game-module-modal .game-color-btn[data-color="gradient-dark"] {
  background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.game-module-modal .game-color-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.game-module-modal .game-color-btn.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 2px var(--mv-primary);
  transform: scale(1.06);
}

.game-module-modal .game-custom-color {
  width: 28px;
  height: 28px;
  border: 2px solid var(--mv-gray-300);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}

.game-module-modal .game-text-color {
  height: 36px;
  cursor: pointer;
}

/* ---- Image animée (création IA) ---- */
.game-module-modal .animatedgif-field-card {
  border: 1px solid #e3e9f3;
  border-radius: 0.85rem;
  background: #ffffff;
  padding: 0.9rem 0.95rem;
  margin-bottom: 0.85rem;
}

.game-module-modal .animatedgif-field-card:last-child {
  margin-bottom: 0;
}

.game-module-modal .animatedgif-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.game-module-modal .animatedgif-prompt-category {
  border-radius: 0.6rem;
  border-color: #d8e4f5;
}

.game-module-modal .animatedgif-prompt-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 0.5rem;
}

.game-module-modal .animatedgif-prompt-card {
  position: relative;
  display: -webkit-box;
  width: 100%;
  text-align: left;
  border: 1px solid #dde5f2;
  border-radius: 0.65rem;
  background: var(--mv-gray-50);
  color: var(--mv-gray-600);
  padding: 0.5rem 1.85rem 0.5rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.game-module-modal .animatedgif-prompt-card:hover {
  border-color: var(--mv-primary-300);
  background: #f0f6ff;
  color: #1e3a8a;
}

.game-module-modal .animatedgif-prompt-card.is-selected {
  border-color: var(--mv-primary);
  background: #eef4ff;
  color: #0f3ea8;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 85, 255, .14);
}

.game-module-modal .animatedgif-prompt-check {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  width: 15px;
  height: 15px;
  color: var(--mv-primary);
  display: none;
  flex: 0 0 auto;
}

.game-module-modal .animatedgif-prompt-card.is-selected .animatedgif-prompt-check {
  display: block;
}

.game-module-modal .animatedgif-duration-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.game-module-modal .animatedgif-duration-row .form-range {
  flex: 1 1 auto;
}

.game-module-modal #animatedGifDuration {
  accent-color: var(--mv-primary);
}

.game-module-modal .animatedgif-duration-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--mv-primary-hover);
  font-weight: 700;
  font-size: 0.76rem;
  flex: 0 0 auto;
}

.game-module-modal .animatedgif-duration-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  color: var(--mv-gray-400);
  margin-top: 0.3rem;
  padding: 0 1px;
}

.game-module-modal .animatedgif-generate-btn {
  --bs-btn-color: #ffffff;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-color: #ffffff;
  --bs-btn-disabled-color: var(--mv-gray-500);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mv-primary) 0%, var(--mv-primary-hover) 100%);
  border: 0;
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  box-shadow: 0 10px 24px rgba(0, 85, 255, .25);
  transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}

.game-module-modal .animatedgif-generate-btn:hover:not(:disabled) {
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 85, 255, .32);
  transform: translateY(-1px);
}

.game-module-modal .animatedgif-generate-btn:disabled {
  background: var(--mv-gray-300);
  color: var(--mv-gray-500);
  box-shadow: none;
  opacity: 0.85;
}

.game-module-modal .animatedgif-tokens-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
  max-width: 100%;
  font-size: 0.72rem;
  color: var(--mv-gray-500);
  background: var(--mv-gray-100);
  border-radius: 999px;
  padding: 0.22rem 0.6rem 0.22rem 0.5rem;
  margin-top: 0.6rem;
}

.game-module-modal .animatedgif-tokens-chip strong {
  color: var(--mv-primary-hover);
}

.game-module-modal .animatedgif-cost-separator {
  color: var(--mv-gray-400);
}

.game-module-modal .animatedgif-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.game-module-modal .animatedgif-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--mv-gray-400);
  text-align: center;
  padding: 1.5rem;
}

.game-module-modal .animatedgif-preview-empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--mv-primary-300);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-module-modal .animatedgif-preview-source {
  position: relative;
  max-width: 100%;
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}

.game-module-modal .animatedgif-preview-source img {
  display: block;
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #fff;
}

.game-module-modal .animatedgif-preview-source-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.game-module-modal .animatedgif-preview-duration-badge {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.game-module-modal .animatedgif-preview-caption {
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: var(--mv-gray-500);
  text-align: center;
}

/* --- Etapes numerotees (colonne gauche) --- */
.game-module-modal .animatedgif-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.game-module-modal .animatedgif-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--mv-primary-hover);
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.game-module-modal .animatedgif-step-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mv-gray-700);
}

/* --- Reprises des styles inline supprimes --- */
.game-module-modal .animatedgif-modal-grid {
  min-height: 560px;
}

.game-module-modal .animatedgif-existing-grid {
  max-height: 420px;
  overflow-y: auto;
}

.game-module-modal .animatedgif-preview-head {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mv-gray-500);
  margin-bottom: 0.55rem;
}

/* --- Feedback d'attente pendant la creation --- */
.game-module-modal .animatedgif-progress {
  margin-top: 0.75rem;
}

.game-module-modal .animatedgif-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--mv-gray-200);
  overflow: hidden;
}

.game-module-modal .animatedgif-progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, var(--mv-primary) 100%);
  animation: animatedgif-progress-slide 1.4s ease-in-out infinite;
}

@keyframes animatedgif-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.game-module-modal .animatedgif-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.game-module-modal .animatedgif-progress-label {
  font-size: 0.74rem;
  color: var(--mv-gray-600);
}

.game-module-modal .animatedgif-progress-timer {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--mv-primary-hover);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.game-module-modal .animatedgif-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(248, 250, 252, .78);
  backdrop-filter: blur(2px);
  color: var(--mv-primary-hover);
  font-size: 0.78rem;
  font-weight: 600;
}

/* --- Mobile : les colonnes s'empilent --- */
@media (max-width: 767.98px) {
  .game-module-modal .animatedgif-modal-grid,
  .game-module-modal .animatedgif-preview-panel {
    min-height: auto;
  }

  .game-module-modal .animatedgif-preview-source img {
    max-height: 220px;
  }
}

/* ==========================================================================
   Modale Image animee — ergonomie (iteration 2)
   Tout est scope #animatedGifModal : .game-media-picker, .game-media-thumb et
   le bloc "Apparence de la carte" sont partages par 14 modales.
   ========================================================================== */

/* --- Zone 1 : selecteur de mode compact dans le header --- */
#animatedGifModal .animatedgif-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--mv-gray-100);
  flex: 0 0 auto;
}

#animatedGifModal .animatedgif-mode-switch label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mv-gray-500);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

#animatedGifModal .animatedgif-mode-switch label:hover {
  color: var(--mv-primary-hover);
}

#animatedGifModal .animatedgif-mode-switch .btn-check:checked + label {
  background: #ffffff;
  color: var(--mv-primary-hover);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

#animatedGifModal .animatedgif-mode-switch .btn-check:focus-visible + label {
  outline: 2px solid var(--mv-primary-300);
  outline-offset: 2px;
}

/* --- Zone 3 : colonne droite en flex, l'apercu absorbe la hauteur libre --- */
#animatedGifModal .animatedgif-right-col {
  display: flex;
  flex-direction: column;
  /* La colonne doit remplir toute la hauteur de la .col pour que l'apercu,
     en flex:1, absorbe l'espace libre au lieu de laisser un vide en bas. */
  height: 100%;
}

#animatedGifModal .animatedgif-preview-panel {
  flex: 1 1 auto;
  min-height: 260px;
}

/* --- Zone 2a : image source en zone cliquable unique --- */
#animatedGifModal .animatedgif-media-picker .animatedgif-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem;
  border: 1.5px dashed var(--mv-gray-300);
  border-radius: 0.75rem;
  background: #fbfdff;
  text-align: center;
  transition: border-color .15s ease, background-color .15s ease;
}

#animatedGifModal .animatedgif-media-picker .animatedgif-image-placeholder:hover {
  border-color: var(--mv-primary-300);
  background: #f8fbff;
}

#animatedGifModal .animatedgif-image-placeholder-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--mv-primary-300);
  display: flex;
  align-items: center;
  justify-content: center;
}

#animatedGifModal .animatedgif-image-placeholder-text {
  font-size: 0.78rem;
  color: var(--mv-gray-500);
}

#animatedGifModal .animatedgif-media-picker .game-media-thumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e3e9f3;
  border-radius: 0.75rem;
  background: #ffffff;
}

#animatedGifModal .animatedgif-media-picker .game-media-thumb img {
  width: 56px;
  height: 56px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--mv-gray-100);
}

#animatedGifModal .animatedgif-media-picker .game-media-thumb-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--mv-gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#animatedGifModal .animatedgif-image-clear {
  flex: 0 0 auto;
  padding: 0.35rem;
  line-height: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mv-gray-400);
  transition: background-color .15s ease, color .15s ease;
}

#animatedGifModal .animatedgif-image-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* --- Zone 2b : styles d'animation en pastilles a libelle court --- */
#animatedGifModal .animatedgif-prompt-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  max-height: none;
  overflow: visible;
}

#animatedGifModal .animatedgif-prompt-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.4rem;
  padding: 0.5rem 0.6rem;
  text-align: center;
  -webkit-line-clamp: none;
  font-size: 0.76rem;
  font-weight: 500;
}

#animatedGifModal .animatedgif-prompt-check {
  position: static;
  width: 13px;
  height: 13px;
}

/* --- Mobile : le selecteur de mode passe pleine largeur sous le titre --- */
@media (max-width: 767.98px) {
  #animatedGifModal .animatedgif-mode-switch {
    width: 100%;
    order: 3;
  }

  #animatedGifModal .animatedgif-mode-switch label {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.7rem;
    white-space: normal;
  }
}

/* ========================================================================== */
/* Module arbre genealogique et hierarchique                                  */
/* ========================================================================== */

.tree-module-modal .tree-modal-dialog {
  max-width: min(1500px, calc(100vw - 2rem));
}

.tree-module-modal .tree-modal-grid {
  min-height: 680px;
}

.tree-module-modal .tree-config-card {
  border: 1px solid #e3e9f3;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.9rem;
}

.tree-module-modal .tree-config-card-head {
  margin-bottom: 0.8rem;
}

.tree-module-modal .tree-config-card-head h6 {
  margin: 0;
  color: var(--mv-text-heading);
  font-size: 0.9rem;
}

.tree-module-modal .tree-config-card-head small {
  color: var(--mv-text-muted);
  font-size: 0.72rem;
}

.tree-module-modal .tree-config-grid,
.tree-module-modal .tree-node-form-grid,
.tree-module-modal .tree-union-grid,
.tree-module-modal .tree-appearance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tree-module-modal .tree-field-wide {
  grid-column: 1 / -1;
}

.tree-module-modal .tree-readonly-field {
  display: flex;
  align-items: center;
  color: var(--mv-gray-500);
  background: var(--mv-gray-50);
}

.tree-module-modal .tree-display-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #edf1f7;
}

.tree-module-modal .tree-display-options .form-check {
  margin: 0;
}

.tree-module-modal .tree-structure-head,
.tree-module-modal .tree-selected-actions,
.tree-module-modal .tree-genealogy-head,
.tree-module-modal .tree-union-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tree-module-modal .tree-structure-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.tree-module-modal .tree-editor-workbench {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.8fr);
  min-height: 390px;
  border: 1px solid #e8edf5;
  border-radius: 0.75rem;
  overflow: hidden;
}

.tree-module-modal .tree-editor-sidebar {
  border-right: 1px solid #e8edf5;
  background: var(--mv-gray-50);
  overflow: auto;
  max-height: 560px;
}

.tree-module-modal .tree-editor-node-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem;
}

.tree-module-modal .tree-editor-node {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: calc(100% - min(calc(var(--tree-node-indent, 0) * 12px), 48px));
  margin-left: min(calc(var(--tree-node-indent, 0) * 12px), 48px);
  padding: 0.55rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--mv-gray-600);
  text-align: left;
  cursor: pointer;
}

.tree-module-modal .tree-editor-node:hover {
  background: #fff;
  border-color: #dbe4f0;
}

.tree-module-modal .tree-editor-node.is-active {
  border-color: #93b4ff;
  background: #eef4ff;
  color: var(--mv-primary-hover);
  box-shadow: 0 4px 12px rgba(0, 85, 255, .1);
}

.tree-module-modal .tree-editor-node-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--tree-node-color, #d6a54a);
}

.tree-module-modal .tree-editor-node-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.tree-module-modal .tree-editor-node-copy strong,
.tree-module-modal .tree-editor-node-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-module-modal .tree-editor-node-copy strong {
  font-size: 0.78rem;
}

.tree-module-modal .tree-editor-node-copy small {
  margin-top: 0.15rem;
  color: var(--mv-text-muted);
  font-size: 0.68rem;
}

.tree-module-modal .tree-editor-main {
  min-width: 0;
  padding: 0.85rem;
  overflow: auto;
}

.tree-module-modal .tree-selected-actions {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #edf1f7;
}

.tree-module-modal .tree-node-image-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tree-module-modal .tree-node-image-preview img {
  width: 48px;
  height: 48px;
  border-radius: 0.55rem;
  object-fit: cover;
  border: 1px solid #dbe4f0;
}

.tree-module-modal .tree-node-image-empty,
.tree-module-modal .tree-editor-empty {
  color: var(--mv-text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 1rem;
}

.tree-module-modal .tree-genealogy-editor {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e8edf5;
}

.tree-module-modal .tree-genealogy-head {
  margin-bottom: 0.7rem;
}

.tree-module-modal .tree-genealogy-head > div {
  min-width: 190px;
}

.tree-module-modal .tree-union-card {
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border: 1px solid #dbe4f0;
  border-radius: 0.75rem;
  background: #fbfcff;
}

.tree-module-modal .tree-union-card:last-child {
  margin-bottom: 0;
}

.tree-module-modal .tree-union-card-head {
  margin-bottom: 0.65rem;
  color: var(--mv-text-heading);
}

.tree-module-modal .tree-union-children {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e8edf5;
}

.tree-module-modal .tree-union-child-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tree-module-modal .tree-union-child-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--mv-primary-hover);
  padding: 0.25rem 0.35rem 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.tree-module-modal .tree-union-child-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #dbe7ff;
  color: var(--mv-primary-hover);
  line-height: 1;
}

.tree-module-modal .tree-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tree-module-modal .tree-category-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0.5rem;
}

.tree-module-modal .tree-category-row input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
  border: 1px solid #dbe4f0;
  border-radius: 0.5rem;
  background: #fff;
}

.tree-module-modal .tree-preview-panel {
  min-height: 520px;
  overflow: auto;
}

.tree-module-modal .tree-preview-label {
  margin-bottom: 0.5rem;
  color: var(--mv-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tree-module-modal #treePreview .maiven-tree-rendered {
  margin: 0 auto !important;
  min-width: 330px;
}

@media (max-width: 1199.98px) {
  .tree-module-modal .tree-modal-grid {
    min-height: auto;
  }

  .tree-module-modal .tree-preview-panel {
    position: static;
    min-height: 420px;
  }
}

@media (max-width: 767.98px) {
  .tree-module-modal .tree-config-grid,
  .tree-module-modal .tree-node-form-grid,
  .tree-module-modal .tree-union-grid,
  .tree-module-modal .tree-appearance-grid,
  .tree-module-modal .tree-editor-workbench {
    grid-template-columns: 1fr;
  }

  .tree-module-modal .tree-editor-sidebar {
    max-height: 210px;
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }

  .tree-module-modal .tree-structure-head,
  .tree-module-modal .tree-genealogy-head {
    align-items: stretch;
    flex-direction: column;
  }

  .tree-module-modal .tree-structure-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 991.98px) {
  .game-module-modal .game-modal-toolbar {
    width: 100%;
    justify-content: flex-end;
  }

  .game-module-modal .game-preview-panel {
    position: static;
    min-height: 220px;
  }

  .game-module-modal .google-review-preview-stage {
    min-height: 190px;
  }

  .game-module-modal .ordering-row-layout {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-module-modal .ordering-row-index {
    grid-column: 1 / 2;
    grid-row: 1;
    margin-bottom: 0.1rem;
  }

  .game-module-modal .ordering-row-fields {
    grid-column: 1 / -1;
  }

  .game-module-modal .ordering-row-actions {
    grid-column: 2;
    grid-row: 1;
    flex-direction: row;
    justify-content: flex-end;
  }

  .game-module-modal .association-pair-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#hotspotModal .hotspot-modal-toolbar .game-scope-group .btn {
  white-space: nowrap;
}

#hotspotModal .hotspot-media-picker .game-media-picker-actions {
  justify-content: flex-start;
}

#hotspotModal .hotspot-media-picker .game-media-thumb img {
  width: 52px;
  height: 52px;
}

/* Maiven Flipcard module */
.flipcard-preview-panel {
  background: #fff;
  border: 1px solid var(--mv-gray-200);
  border-radius: 12px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.flipcard-preview-stage {
  align-items: center;
  background: var(--mv-gray-50);
  border: 1px solid var(--mv-gray-200);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  min-height: 320px;
  padding: 1rem;
}

.flipcard-container {
  --flipcard-aspect-ratio: 4 / 3;
  --flipcard-max-width: 320px;
  margin: 1rem auto;
  max-width: var(--flipcard-max-width);
  perspective: 1000px;
  width: 100%;
}

.flipcard-preview-container {
  margin: 0 auto;
}

.flipcard-wrapper {
  aspect-ratio: var(--flipcard-aspect-ratio);
  cursor: pointer;
  position: relative;
  width: 100%;
}

.flipcard-inner {
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  width: 100%;
}

.flipcard-wrapper.flipped .flipcard-inner {
  transform: rotateY(180deg);
}

.flipcard-face {
  align-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--flipcard-bg);
  border-radius: var(--flipcard-radius);
  box-shadow: var(--flipcard-shadow);
  color: var(--flipcard-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  overflow: hidden;
  padding: 20px;
  position: absolute;
  text-align: center;
  top: 0;
  width: 100%;
}

.flipcard-face-back {
  transform: rotateY(180deg);
}

.flipcard-face-content {
  align-items: center;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 0;
}

.flipcard-icon {
  align-items: center;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  margin-bottom: .6rem;
  width: 42px;
}

.flipcard-icon img {
  filter: brightness(0) invert(1);
  height: 22px;
  opacity: .95;
  width: 22px;
}

.flipcard-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
  margin-bottom: .4rem;
  opacity: .78;
  text-transform: uppercase;
}

.flipcard-image {
  line-height: 0;
  margin-bottom: .75rem;
}

.flipcard-image img {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15,23,42,.18);
  max-height: 220px;
  max-width: 100%;
}

.flipcard-title {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .45rem;
  overflow-wrap: anywhere;
}

.flipcard-content {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.flipcard-turn-icon {
  bottom: 12px;
  opacity: .48;
  position: absolute;
  right: 12px;
}

.flipcard-hint {
  color: #6b7280;
  font-size: .75rem;
  margin: .5rem 0 0;
  text-align: center;
}

.flipcard-bg-picker .flipcard-color-btn {
  border: 2px solid transparent;
  border-radius: 6px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

.flipcard-bg-picker .flipcard-color-btn.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17,24,39,.12);
}

.flipcard-custom-color {
  border: 2px solid var(--mv-gray-300);
  border-radius: 6px;
  cursor: pointer;
  height: 28px;
  padding: 0;
  width: 28px;
}

.flipcard-selected-image {
  align-items: center;
  background: var(--mv-gray-50);
  border: 1px solid var(--mv-gray-300);
  border-radius: 8px;
  display: flex;
  gap: .5rem;
  padding: .5rem;
}

.flipcard-selected-image img {
  border-radius: 6px;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

@media (max-width: 991.98px) {
  .flipcard-preview-panel {
    position: static;
  }
}
