/* Alfabetização Emocional (scripts/features/emotion-literacy.js): visual como o dos Fonemas (fundo azul bem claro,
   título forte, passos numerados em quadros brancos) com a cor da emoção escolhida (--emo). */

/* Sem barra lateral: o quadro do treino ocupa a largura toda. */
body[data-active-module="emotionLiteracy"] #view-treino.is-active > .session-panel { display: none !important; }
body[data-active-module="emotionLiteracy"] #view-treino.is-active { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; }
.trainer:has(.el-root) { display: block; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: clamp(10px, 2vw, 22px); background: #eef4fb; }
body[data-app-view="treino"] #view-treino.is-active > .trainer:has(.el-root[data-screen="home"]) { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.trainer:has(.el-root[data-screen="game"]) { overflow: hidden; }
.trainer:has(.el-root[data-screen="game"]) > .choices.el-host { height: 100%; }
.choices.el-host, body[data-design] .choices.el-host, body.training-fullscreen .choices.el-host { display: block; width: 100%; max-width: none; min-width: 0; margin: 0; }
body.training-fullscreen .trainer:has(.el-root) { position: fixed; inset: 0; z-index: 1; padding: 66px 14px 12px; }
body.training-fullscreen.controls-hidden .trainer:has(.el-root) { padding-top: 12px; }

.el-root { --ink: #24343d; --muted: #5f6f78; width: 100%; min-width: 0; color: var(--ink); font-family: "Nunito", system-ui, sans-serif; }
.el-face { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 18px; background: #fff; }
.el-face img { display: block; width: 100%; height: auto; }
/* O nome escrito embaixo da figura fica de fora (recorte: só o rosto). */
.el-face.is-c img { width: 112%; margin-left: -6%; }
.el-face.is-f img { width: 134%; margin-left: -17%; }

/* ---------- Tela inicial ---------- */
.el-root[data-screen="home"] { display: grid; gap: 16px; max-width: 1080px; margin: 0 auto; padding-bottom: 14px; }
.el-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 6px 4px 2px; }
.el-header h2 { margin: 0 0 8px; color: #c2412d; font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 900; line-height: 1.1; }
.el-header p { margin: 0; max-width: 600px; color: var(--muted); font-size: clamp(0.98rem, 1.6vw, 1.12rem); line-height: 1.5; }
.el-header p b { color: var(--ink); }
.el-fan { display: flex; align-items: flex-end; padding-right: 6px; }
.el-fan .el-face { width: clamp(70px, 9vw, 100px); box-shadow: 0 6px 18px rgba(30, 60, 90, 0.16); }
.el-fan .el-face + .el-face { margin-left: -14px; }
.el-fan .el-face:nth-child(1) { rotate: -6deg; }
.el-fan .el-face:nth-child(2) { translate: 0 -8px; z-index: 1; }
.el-fan .el-face:nth-child(3) { rotate: 6deg; }

.el-step { display: grid; gap: 14px; padding: clamp(16px, 2.6vw, 26px); border-radius: 24px; background: #fff; box-shadow: 0 2px 10px rgba(30, 60, 90, 0.06); }
.el-step h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0; font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 800; }
.el-step h3 small { color: #8a99a2; font-size: 0.95rem; font-weight: 600; }
.el-step-number { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #c2412d; color: #fff; font-weight: 900; }

.el-emotions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.el-emotion {
  display: grid; justify-items: center; gap: 6px; padding: 10px 8px 12px; border: 3px solid transparent; border-radius: 20px;
  background: var(--emo-soft); color: var(--ink); font: inherit; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease;
}
.el-emotion .el-face { width: 100%; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); }
.el-emotion strong { font-size: clamp(0.95rem, 1.5vw, 1.15rem); font-weight: 900; color: var(--emo); filter: brightness(0.85); }
.el-emotion small { font-weight: 800; color: #17803f; font-size: 0.8rem; }
.el-emotion.is-active { border-color: var(--emo); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emo) 25%, transparent); transform: translateY(-3px); }

.el-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.el-game {
  position: relative; display: grid; align-content: start; gap: 6px; padding: 8px 8px 12px; border: 2px solid #dbe5ec; border-radius: 20px;
  background: #fff; color: var(--ink); font: inherit; text-align: center; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.el-game:hover, .el-game:focus-visible { border-color: var(--emo); box-shadow: 0 6px 16px rgba(30, 60, 90, 0.12); }
.el-game:active { transform: scale(0.97); }
.el-game-cover { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.el-game-cover svg { width: 100%; height: 100%; display: block; }
.el-game-n { position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--emo); color: #fff; font-weight: 900; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.el-soon-tag { position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(36, 52, 61, 0.78); color: #fff; font-size: 0.72rem; font-weight: 900; }
.el-game strong { font-size: 0.98rem; font-weight: 900; line-height: 1.2; }
.el-game small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.el-game em { font-style: normal; font-weight: 900; color: #17803f; font-size: 0.85rem; }
.el-game.is-done { border-color: #9fdcb9; background: #f3fbf6; }
.el-game.is-soon .el-game-cover svg { filter: saturate(0.8); }
.el-game.is-shaking { animation: el-shake 0.45s ease; }
.el-game.is-shaking::after {
  content: "Em breve!"; position: absolute; left: 50%; top: 38%; padding: 6px 14px; border-radius: 999px; background: #2f6fd6; color: #fff;
  font-weight: 900; white-space: nowrap; transform: translateX(-50%); animation: el-bubble 1.6s ease forwards; pointer-events: none; z-index: 2;
}
@keyframes el-bubble { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Jogos ---------- */
.el-root[data-screen="game"] {
  height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; position: relative;
  padding: clamp(10px, 1.6vw, 16px); border-radius: 24px; background: linear-gradient(180deg, var(--emo-soft), #ffffff 65%); box-sizing: border-box;
}
.el-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.el-back, .el-again, .el-next, .el-say.big {
  min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; font: inherit; font-weight: 900; cursor: pointer;
}
.el-back { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d6e0e7; }
.el-bar-emotion { padding: 6px 14px; border-radius: 999px; background: var(--emo); color: #fff; font-weight: 900; }
.el-bar-title { font-size: clamp(1.05rem, 1.9vw, 1.35rem); font-weight: 900; }
.el-phase { margin-left: auto; display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); }
.el-phase button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.el-phase button.is-active { background: var(--emo); color: #fff; }
body.training-fullscreen .el-bar .el-back { display: none; }
.el-task { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; font-size: clamp(1.3rem, 2.8vw, 2rem); font-weight: 900; text-align: center; }
.el-say { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: #2f6fd6; color: #fff; font-size: 1.25rem; cursor: pointer; }
.el-say.big { width: auto; border-radius: 14px; }
.el-stage { min-height: 0; display: grid; gap: 10px; align-content: center; }
.el-progress { display: flex; justify-content: center; gap: 8px; }
.el-progress i { width: 14px; height: 14px; border-radius: 50%; background: #d6e0e7; }
.el-progress i.is-done { background: #2fb36f; }
.el-progress i.is-now { background: var(--emo); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emo) 30%, transparent); }

/* 1. Vídeo */
.el-meet { min-height: 0; height: 100%; display: flex; justify-content: center; gap: clamp(12px, 2vw, 24px); align-items: center; }
.el-video { position: relative; justify-self: center; width: auto; max-width: 100%; height: auto; max-height: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 0; border: 4px solid var(--emo); border-radius: 22px; background: #fff; overflow: hidden; cursor: pointer; }
.el-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.el-video:not(.is-waiting) { flex: 0 1 auto; height: 100%; width: auto; max-width: calc(100% - clamp(250px, 30%, 420px) - 24px); }
.el-video.is-waiting { flex: 1.3; }
.el-about { flex: 0 0 clamp(250px, 30%, 420px); min-width: 0; }
.el-replay { position: absolute; right: 12px; bottom: 12px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(15, 92, 153, 0.85); color: #fff; font-size: 1.4rem; }
.el-video.is-waiting { cursor: default; gap: 8px; align-content: center; }
.el-video.is-waiting .el-face { width: 46%; }
.el-video.is-waiting small { color: var(--muted); font-weight: 800; }
.el-about { display: grid; gap: 12px; align-content: center; }
.el-about h4 { margin: 0; color: var(--emo); font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 900; filter: brightness(0.85); }
.el-about p { margin: 0; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 700; line-height: 1.45; }
.el-about button { justify-self: start; }
.el-next { background: #22a55b; color: #fff; box-shadow: 0 4px 0 #17803f; }
.el-again { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d6e0e7; }

/* 2. Qual é o rosto? */
.el-options { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(10px, 2vw, 22px); max-width: min(100%, calc(var(--n) * 260px)); margin: 0 auto; width: 100%; }
.el-option { padding: 8px; border: 4px solid #fff; border-radius: 24px; background: #fff; box-shadow: 0 6px 16px rgba(30, 60, 90, 0.12); cursor: pointer; transition: transform 0.15s ease; }
.el-option:active { transform: scale(0.96); }
.el-option.is-right, .el-name.is-right { border-color: #2fb36f; box-shadow: 0 0 0 6px rgba(47, 179, 111, 0.3); transform: scale(1.05); }
.el-option.is-wrong, .el-name.is-wrong { animation: el-shake 0.45s ease; filter: grayscale(1); opacity: 0.45; }
@keyframes el-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* 3. Qual é o nome? */
.el-name-game { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(14px, 3vw, 34px); align-items: center; max-width: 900px; margin: 0 auto; width: 100%; }
.el-name-game > .el-face { width: min(100%, 320px); justify-self: center; border: 6px solid #fff; box-shadow: 0 8px 20px rgba(30, 60, 90, 0.16); }
.el-names { display: grid; gap: 12px; }
.el-name { min-height: 64px; border: 4px solid var(--emo); border-radius: 20px; background: var(--emo-soft); color: var(--ink); font: inherit; font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 900; cursor: pointer; }

/* 4. Onde sinto no corpo */
.el-body { min-height: 0; height: 100%; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(12px, 2vw, 24px); align-items: center; }
.el-body-figure { position: relative; height: 100%; max-height: 62vh; aspect-ratio: 240 / 414; justify-self: center; }
.el-body-figure .mm-avatar { width: 100%; height: 100%; display: block; }
.el-spot { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; padding: 0; border: 4px solid #fff; border-radius: 50%; background: rgba(36, 52, 61, 0.35); cursor: pointer; animation: el-pulse 1.8s ease-in-out infinite; }
.el-spot span { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.72rem; font-weight: 900; white-space: nowrap; pointer-events: none; }
.el-spot.is-on { background: var(--emo); box-shadow: 0 0 0 6px color-mix(in srgb, var(--emo) 35%, transparent), 0 0 24px var(--emo); animation: none; }
@keyframes el-pulse { 50% { transform: scale(1.12); } }
.el-body-list { display: grid; gap: 10px; align-content: center; }
.el-body-list h4 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 900; color: var(--emo); filter: brightness(0.85); }
.el-body-list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.el-body-list li { padding: 10px 14px; border-left: 6px solid var(--emo); border-radius: 12px; background: #fff; font-size: clamp(1rem, 1.7vw, 1.2rem); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.el-body-list .el-next { justify-self: start; }
.el-hint { margin: 0; color: var(--muted); font-weight: 800; }

/* 5 e 6. Situações */
.el-situation { justify-self: center; display: flex; align-items: center; gap: 16px; max-width: 760px; padding: clamp(14px, 2.4vw, 26px) clamp(18px, 3vw, 34px); border-radius: 26px; background: #fff; box-shadow: 0 8px 22px rgba(30, 60, 90, 0.14); animation: el-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes el-in { from { transform: scale(0.8); opacity: 0; } }
.el-situation-emoji { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; }
.el-situation b { font-size: clamp(1.25rem, 2.6vw, 1.9rem); font-weight: 900; }
.el-yesno { display: flex; justify-content: center; gap: 16px; }
.el-yes, .el-no { min-height: 70px; min-width: 170px; padding: 0 24px; border: 0; border-radius: 22px; color: #fff; font: inherit; font-size: 1.5rem; font-weight: 900; cursor: pointer; }
.el-yes { background: #22a55b; box-shadow: 0 5px 0 #17803f; }
.el-no { background: #e5484d; box-shadow: 0 5px 0 #b42323; }
.el-yes.is-picked, .el-no.is-picked, .el-level.is-picked { transform: scale(1.08); }
.el-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; max-width: 720px; width: 100%; margin: 0 auto; height: clamp(160px, 30vh, 260px); }
.el-level { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; gap: 4px; padding: 6px 4px; border: 0; border-radius: 16px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.el-level-bar { align-self: end; width: 70%; height: var(--h); border-radius: 10px; background: var(--emo); opacity: calc(0.35 + var(--h) / 160%); }
.el-level b { font-size: 1.4rem; font-weight: 900; }
.el-level small { font-weight: 800; color: var(--muted); }
.el-summary { max-width: 820px; width: 100%; margin: 0 auto; display: grid; gap: 12px; }
.el-summary h4 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 900; }
.el-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.el-chip { padding: 8px 14px; border-radius: 999px; background: var(--emo-soft); border: 2px solid var(--emo); font-weight: 800; }
.el-bars { display: grid; gap: 8px; }
.el-bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #fff; font-weight: 800; }
.el-bar-row i { height: 16px; border-radius: 999px; background: linear-gradient(90deg, var(--emo) calc(var(--level) * 20%), #e6edf2 0); }
.el-stars { text-align: center; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: 6px; }

/* Fim do minijogo */
.el-finish { position: absolute; left: 50%; bottom: 18px; z-index: 3; display: grid; gap: 10px; justify-items: center; padding: 14px 20px; border-radius: 22px; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); transform: translateX(-50%); animation: el-in 0.35s ease; }
.el-finish b { font-size: 1.4rem; }
.el-finish div { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (orientation: portrait) {
  .el-emotions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .el-meet, .el-name-game, .el-body { grid-template-columns: minmax(0, 1fr); }
  .el-header { grid-template-columns: minmax(0, 1fr); }
  .el-fan { display: none; }
}
