/* Como Estou Me Sentindo: pôster "Estou me sentindo / Eu preciso" e quadro verde com os cartões
   (lógica em scripts/features/feelings-board.js). Mesmo desenho dos Balões de Pensamento. */
body[data-design] .choices.feelings-workspace {
  --feelings-height: clamp(380px, calc(100dvh - 190px), 800px);
  --feelings-green: #66c18c;
  display: block;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

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

/* Deitado: o pôster à esquerda e o quadro verde com os cartões à direita. */
body[data-design] .feelings-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: clamp(10px, 1.6vw, 20px);
  height: var(--feelings-height);
}

/* Pôster (igual ao da Twinkl): borda verde, texto à esquerda e o espaço quadrado à direita. */
body[data-design] .feelings-poster {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: clamp(14px, 2.4vw, 32px);
  border: clamp(5px, 0.8vw, 9px) solid var(--feelings-green);
  border-radius: clamp(18px, 2.4vw, 30px);
  background: #fff;
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.12);
  container-type: size;
  cursor: pointer;
}

body[data-design] .feelings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2cqw, 24px);
  min-height: 0;
}

body[data-design] .feelings-label {
  color: #292627;
  font-size: clamp(1.1rem, 7.5cqw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: right;
}

body[data-design] .feelings-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: min(40cqh, 44cqw);
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  border: 3px solid #b0b4b9;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

body[data-design] .feelings-slot-plus {
  color: #b0b4b9;
  font-size: clamp(1.6rem, 9cqw, 3.4rem);
  font-weight: 300;
  line-height: 1;
}

body[data-design] .feelings-slot.is-filled {
  border-color: transparent;
}

body[data-design] .feelings-slot.is-filled img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: feelingsIn 0.35s ease;
}

body[data-design] .feelings-slot.is-target {
  border-color: var(--feelings-green);
  box-shadow: 0 0 0 5px rgba(102, 193, 140, 0.35);
}

body[data-design] .feelings-slot.is-wrong {
  animation: feelingsShake 0.5s ease;
  border-color: #e05050;
}

@keyframes feelingsIn {
  from { transform: scale(0.6); opacity: 0.3; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes feelingsShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Quadro verde de escola com moldura de madeira (como nos Balões de Pensamento). */
body[data-design] .feelings-board {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: clamp(10px, 1.5vw, 18px);
  border: clamp(8px, 1.1vw, 13px) solid #b07a45;
  border-radius: clamp(14px, 1.8vw, 20px);
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(255, 255, 255, 0.05), transparent 50%),
    #2f6b4a;
  box-shadow: inset 0 0 0 3px #8a5a2e, inset 0 0 28px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(24, 32, 42, 0.18);
  container-type: size;
}

/* Ferramentas do quadro (Editar quadro). Somem na tela cheia. */
body[data-design] .feelings-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

body.training-fullscreen .feelings-tools {
  display: none;
}

body[data-design] .feelings-edit-button {
  min-height: 40px;
  padding: 6px 16px;
  border: 2px solid #f7f5ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f7f5ea;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

body[data-design] .feelings-edit-button.is-active {
  background: #f7f5ea;
  color: #2f6b4a;
}

/* Cartões: tamanho e colunas calculados para todos caberem (layoutBoard em feelings-board.js). */
body[data-design] .feelings-options {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), var(--card, 120px));
  grid-auto-rows: var(--card, 120px);
  justify-content: center;
  align-content: center;
  gap: 10px;
}

body[data-design] .feelings-empty {
  margin: 0;
  color: #f7f5ea;
  font-weight: 800;
  text-align: center;
}

.feelings-chooser .feelings-empty {
  color: #475569;
}

body[data-design] .feelings-option {
  position: relative;
}

/* Editando: × para tirar e o quadrado + para acrescentar. */
body[data-design] .feelings-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #e05050;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

body[data-design] .feelings-workspace.is-editing .feelings-option {
  cursor: default;
}

body[data-design] .feelings-option.feelings-add {
  display: grid;
  place-items: center;
  border: 3px dashed #f7f5ea;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f5ea;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
}

body[data-design] .feelings-option {
  display: block;
  aspect-ratio: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10%;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

body[data-design] .feelings-option img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

body[data-design] .feelings-option.is-selected {
  transform: scale(1.05);
  box-shadow: 0 0 0 5px #ffd34d;
}

body[data-design] .feelings-option.is-dragging {
  opacity: 0.35;
}

/* Cartão que já está no pôster fica apagadinho no quadro. */
body[data-design] .feelings-option.is-used {
  opacity: 0.25;
  cursor: default;
}

body[data-design] .feelings-option.feelings-drag-preview,
.feelings-drag-preview {
  position: fixed;
  z-index: 10000;
  margin: 0;
  pointer-events: none;
  box-shadow: 0 16px 30px rgba(24, 32, 42, 0.3);
  transition: none !important;
  animation: none !important;
}

/* Escolha ao concluir: só Refazer e Prosseguir no quadro verde. */
body[data-design] .feelings-lead {
  margin: 0 0 clamp(10px, 1.6vh, 16px);
  color: #f7f5ea;
  font-size: clamp(1.1rem, 2.3vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

body[data-design] .feelings-board-actions {
  display: grid;
  gap: clamp(12px, 2vh, 20px);
  width: min(100%, 360px);
  margin: 0 auto;
}

body[data-design] .feelings-board-actions .block-choice-button {
  width: 100%;
  min-height: clamp(60px, 9vh, 84px);
}

/* Tela com todas as emoções (ou todas as ações). */
.feelings-chooser {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}

.feelings-chooser-panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 900px);
  max-height: min(92dvh, 860px);
  box-sizing: border-box;
  padding: clamp(14px, 2vw, 22px);
  border: 8px solid #66c18c;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.feelings-chooser-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feelings-chooser-panel h3 {
  margin: 0;
  color: #292627;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  font-weight: 900;
}

.feelings-chooser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 16vw, 150px), 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
}

.feelings-chooser-grid .feelings-option {
  cursor: pointer;
  touch-action: auto;
}

/* Deitado, na tela cheia: o quadro desce um pouco para não ficar sob os botões do canto. */
@media (orientation: landscape) {
  body.training-fullscreen .feelings-board {
    padding-top: 56px;
  }
}

/* Em pé fora da tela cheia: a barra de ajustes fica embaixo; pôster e quadro continuam lado a lado. */
@media (orientation: portrait) {
  body[data-design]:not(.training-fullscreen) .choices.feelings-workspace {
    --feelings-height: clamp(380px, calc(100dvh - 520px), 760px);
  }
}

/* Em pé, na tela cheia: o pôster em cima e o quadro com os cartões embaixo. */
@media (orientation: portrait) {
  body.training-fullscreen .choices.feelings-workspace {
    --feelings-height: calc(100dvh - 130px);
    margin-top: 40px;
  }

  body.training-fullscreen .feelings-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

}

/* Os cartões já têm a borda arredondada desenhada (cantos transparentes): sem fundo branco atrás. */
body[data-design] .feelings-slot.is-filled {
  background: transparent;
}

.feelings-chooser-grid .feelings-option {
  background: transparent;
}
