/* Causalidade: capa do módulo, telas de causa e efeito e ajustes para telas menores. */
.module-grid .art-causality {
  display: grid;
  place-items: center;
  background: #f3f8fb;
}

.causality-cover-flow {
  width: 92%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.module-grid .art-causality .causality-cover-flow img {
  width: 100%;
  height: 104px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.module-grid .art-causality .causality-cover-flow img.causality-cover-arrow {
  height: 26px;
}

.trainer:has(.causality-workspace),
.trainer:has(.causality-result) {
  align-content: start;
  gap: clamp(12px, 2vh, 22px);
}

.causality-host {
  display: block;
  width: min(100%, 1120px);
}

.causality-workspace {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 2.4vh, 30px);
}

.causality-scene {
  width: min(100%, 940px);
  min-height: clamp(130px, 19vh, 190px);
  display: grid;
  place-items: center;
  gap: 12px;
  padding: clamp(14px, 2vw, 24px);
  border: 3px solid #8eb8d4;
  border-radius: 8px;
  background: #eaf4fb;
  box-shadow: 0 8px 18px rgba(29, 55, 72, 0.07);
}

.causality-scene-image {
  position: relative;
  width: min(100%, 360px);
  min-height: 0;
  aspect-ratio: 1.08 / 1;
  grid-template-columns: 1fr;
}

.causality-scene-image > img {
  grid-column: 1;
  width: 86%;
  height: 86%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.causality-scene-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #356a80;
  font-size: 0.78rem;
  font-weight: 950;
}

.causality-scene-social,
.causality-scene-text {
  width: min(100%, 720px);
  min-height: clamp(180px, 24vh, 240px);
  align-content: center;
}

.causality-scene-relation,
.causality-scene-chain {
  width: min(100%, 940px);
  align-content: center;
}

.causality-scene p {
  max-width: 860px;
  margin: 0;
  color: #243847;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.causality-scene-thumbnails {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.causality-scene-thumbnails img {
  width: clamp(76px, 9vw, 120px);
  height: clamp(74px, 11vh, 110px);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.causality-flow {
  width: min(100%, 700px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vw, 20px);
}

.causality-flow > img:not(.causality-arrow) {
  width: clamp(90px, 13vw, 150px);
  height: clamp(82px, 12vh, 120px);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.causality-flow > img.causality-arrow {
  width: clamp(44px, 6vw, 70px);
  height: 34px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.causality-chain-flow > img:not(.causality-arrow) {
  width: clamp(74px, 10vw, 120px);
}

.causality-question-band {
  width: min(94%, 920px);
  min-height: clamp(78px, 11vh, 112px);
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 24px);
  border: 5px solid #21bdc5;
  border-radius: 8px;
  background: #fbf4e8;
  color: #101828;
  box-shadow: 0 10px 22px rgba(29, 55, 72, 0.1);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
}

.causality-probe-label {
  color: #2f7d8b;
  font-size: 0.78rem;
  font-weight: 950;
}

.causality-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 26px);
}

.causality-workspace[data-count="2"] .causality-options {
  width: min(100%, 720px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.causality-workspace[data-count="4"] .causality-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.causality-option {
  min-width: 0;
  min-height: clamp(145px, 21vh, 210px);
  display: grid;
  place-items: center;
  padding: clamp(12px, 1.8vw, 20px);
  border: 3px solid #cad6dc;
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  box-shadow: 0 10px 22px rgba(29, 55, 72, 0.09);
  touch-action: manipulation;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.causality-option:focus-visible {
  border-color: #2fb5bd;
  transform: translateY(-2px);
}
@media (hover: hover) and (pointer: fine) {
.causality-option:hover {
  border-color: #2fb5bd;
  transform: translateY(-2px);
}
}

.causality-option img {
  width: min(88%, 190px);
  height: clamp(108px, 16vh, 165px);
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.causality-option-text span {
  max-width: 100%;
  font-size: clamp(1.15rem, 2.4vw, 1.9rem);
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.causality-option.is-selected {
  border-color: #1689b0;
  background: #e7f6fb;
  box-shadow: 0 0 0 4px rgba(22, 137, 176, 0.14);
}

.causality-option.is-hint {
  border-color: #1689b0;
  box-shadow: 0 0 0 5px rgba(22, 137, 176, 0.2);
}

.causality-option.correct {
  border-color: #16a34a;
  background: #eaf8ee;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.causality-option.wrong {
  border-color: #dc3545;
  background: #fff0f1;
}

.causality-confirm {
  min-width: min(100%, 260px);
}

.causality-hint {
  margin: 0;
  color: #536874;
  font-weight: 850;
  text-align: center;
}

.feedback.neutral {
  color: #536874;
}

.causality-result {
  width: min(100%, 700px);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 5vw, 54px);
  border: 3px solid #b9d9c3;
  border-radius: 8px;
  background: #f2fbf5;
  color: #101828;
  text-align: center;
}

.causality-result-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 950;
}

.causality-result h2,
.causality-result p,
.causality-result small {
  margin: 0;
}

.causality-result small {
  color: #536874;
  font-size: 0.95rem;
  font-weight: 750;
}

.causality-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

body[data-design="dark"] .causality-scene {
  border-color: #5f849b;
  background: #142531;
}

body[data-design="dark"] .causality-scene p,
body[data-design="dark"] .causality-option,
body[data-design="dark"] .causality-result {
  color: #ffffff;
}

body[data-design="dark"] .causality-option {
  border-color: #53636f;
  background: #18232c;
}

body[data-design="dark"] .causality-question-band {
  background: #18232c;
  color: #ffffff;
}

body[data-design="dark"] .causality-result {
  border-color: #4b7f5a;
  background: #15261b;
}

body.training-fullscreen .trainer:has(.causality-workspace) {
  align-content: start;
  padding-block: clamp(16px, 2.5vh, 30px);
}

body.training-fullscreen .causality-host {
  width: min(96vw, 1240px);
}

body.training-fullscreen .causality-option {
  min-height: clamp(170px, 25vh, 270px);
}

body.training-fullscreen .causality-option img {
  height: clamp(130px, 20vh, 220px);
}

@media (max-width: 760px) {
  .causality-workspace {
    gap: 16px;
  }

  .causality-scene {
    min-height: 120px;
  }

  .causality-scene-image {
    width: min(100%, 310px);
    grid-template-columns: 1fr;
  }

  .causality-scene-image > img,
  .causality-scene-badge {
    grid-column: 1;
  }

  .causality-flow {
    gap: 5px;
  }

  .causality-flow > img:not(.causality-arrow) {
    width: clamp(64px, 22vw, 96px);
  }

  .causality-flow > img.causality-arrow {
    width: 34px;
  }

  .causality-question-band {
    width: 100%;
    min-height: 72px;
  }

  .causality-options,
  .causality-workspace[data-count="2"] .causality-options,
  .causality-workspace[data-count="4"] .causality-options {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .causality-options .causality-option:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 6px);
    justify-self: center;
  }

  .causality-option {
    min-height: 128px;
    padding: 9px;
  }

  .causality-option img {
    height: 104px;
  }
}
