/* Termômetro das Emoções (lógica e desenhos em scripts/features/emotion-thermometer.js). */
body[data-design] .choices.et-workspace {
  --et-height: clamp(400px, calc(100dvh - 150px), 880px);
  display: block;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

body.training-fullscreen .choices.et-workspace {
  --et-height: calc(100dvh - 40px);
}

body[data-design] .et-page {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  height: var(--et-height);
  padding: clamp(10px, 2vw, 24px);
  box-sizing: border-box;
}

body[data-design] .et-workspace.is-termometro .et-page {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 1.1fr);
}

/* Régua (larga): em cima, ocupando a largura toda, e o cartão embaixo. */
body[data-design] .et-workspace.is-regua .et-page {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}

body[data-design] .et-workspace.is-regua .et-card {
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  justify-items: start;
  align-items: center;
  column-gap: 18px;
  justify-self: center;
  min-width: min(520px, 100%);
  text-align: left;
}

body[data-design] .et-workspace.is-regua .et-card svg {
  grid-row: 1 / 3;
  width: clamp(90px, 12vw, 130px);
}

body[data-design] .et-workspace.is-regua .et-card.is-empty {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

/* O modelo ocupa o maior espaço possível; tocar e arrastar não rolam a página. */
body[data-design] .et-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  height: 100%;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

body[data-design] .et-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: visible;
}

/* Rosto da emoção escolhida: cresce; os outros ficam um pouco apagados (velocímetro e régua). */
body[data-design] .et-level {
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

body[data-design] .et-thermo .et-level.is-chosen,
body[data-design] .et-ruler .et-level.is-chosen {
  transform: scale(1.22);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}

body[data-design] .et-gauge .et-level.is-chosen {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)) brightness(1.08);
}

body[data-design] .et-level.is-dim {
  opacity: 0.55;
  filter: saturate(0.7);
}

body[data-design] .et-needle {
  transition: transform 0.12s ease-out;
}

/* Cartão com a emoção escolhida. */
body[data-design] .et-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: clamp(16px, 2.4vw, 28px);
  border: 6px solid var(--et-color, #cfd5db);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(24, 32, 42, 0.12);
  text-align: center;
  animation: et-card-in 0.3s ease;
}

body[data-design] .et-card svg {
  width: clamp(110px, 16vw, 190px);
  height: auto;
}

body[data-design] .et-card span {
  color: #4b5563;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 800;
}

body[data-design] .et-card strong {
  color: #1f2937;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  font-weight: 900;
  line-height: 1.05;
}

body[data-design] .et-card.is-empty {
  border-style: dashed;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.7);
}

body[data-design] .et-card.is-empty p {
  margin: 0;
  color: #64748b;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
}

@keyframes et-card-in {
  from { transform: scale(0.92); opacity: 0.4; }
}

/* Em pé: o modelo em cima e o cartão embaixo. */
@media (orientation: portrait) {
  body[data-design]:not(.training-fullscreen) .choices.et-workspace {
    --et-height: clamp(460px, calc(100dvh - 330px), 900px);
  }

  body[data-design] .et-page,
  body[data-design] .et-workspace.is-termometro .et-page {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  body[data-design] .et-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    justify-items: start;
    align-items: center;
    column-gap: 18px;
    text-align: left;
  }

  body[data-design] .et-card svg {
    grid-row: 1 / 3;
    width: clamp(90px, 18vw, 140px);
  }

  body[data-design] .et-card.is-empty {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}

/* Barra lateral: modelos com miniatura. */
.et-model-buttons {
  display: grid;
  gap: 6px;
}

.et-model-button {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  justify-items: start;
  gap: 10px;
  min-width: 0;
  padding: 6px 4px;
  border: 2px solid #dce8f1;
  border-radius: 12px;
  background: #fff;
  color: #1f2f44;
  font: inherit;
  cursor: pointer;
}

.et-model-button.is-selected {
  border-color: #18a9ea;
  background: #e8f6fd;
  box-shadow: 0 0 0 2px rgba(24, 169, 234, 0.25);
}

.et-model-button small {
  font-size: 0.9rem;
  font-weight: 900;
}

.et-model-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 46px;
  pointer-events: none;
}

.et-model-thumb svg {
  width: 100%;
  height: 100%;
}

/* Em pé a barra de ajustes fica embaixo: os modelos lado a lado, para ela não crescer. */
@media (orientation: portrait) {
  .et-model-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .et-model-button {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 4px 2px;
  }

  .et-model-thumb {
    width: 100%;
    height: 40px;
  }

  .et-model-button small {
    font-size: 0.7rem;
  }
}

/* Miniatura com altura fixa (a do termômetro em pé não pode crescer). */
.et-model-thumb {
  display: block;
}

body[data-design] .et-model-thumb .et-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
}
