/* Meu mural (scripts/features/my-mural.js): mural de cortiça com o personagem no meio e o editor do personagem. */

/* Sem barra lateral: o quadro do treino ocupa a largura toda. */
body[data-active-module="myMural"] #view-treino.is-active > .session-panel { display: none !important; }
body[data-active-module="myMural"] #view-treino.is-active { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; }
.trainer:has(.mm-root) { display: block; min-width: 0; overflow: hidden; padding: clamp(8px, 1.4vw, 16px); }
.trainer:has(.mm-root) > .choices.mm-host { height: 100%; }
.choices.mm-host { display: block; width: 100%; max-width: none; min-width: 0; margin: 0; }
/* Tela cheia: o mural e o quadro ocupam a tela toda (sem margem nem cantos); o conteúdo começa abaixo dos botões do app. */
body.training-fullscreen .trainer:has(.mm-root) { position: fixed; inset: 0; z-index: 1; padding: 0; }
body.training-fullscreen .mm-board { border-radius: 0; padding-top: 66px; border-width: 10px; }
body.training-fullscreen .mg-root { border-radius: 0; padding: 66px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); box-shadow: none; }
body.training-fullscreen.controls-hidden .mm-board { padding-top: clamp(12px, 2vh, 22px); }
body.training-fullscreen.controls-hidden .mg-root { padding-top: 14px; }
body.training-fullscreen .mm-editor { padding-top: 66px; border-radius: 0; }
body.training-fullscreen.controls-hidden .mm-editor { padding-top: 12px; }

.mm-root {
  height: 100%;
  min-height: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: #3a2a1a;
}
.mm-avatar { display: block; width: 100%; height: 100%; }

/* ---------- Mural ---------- */
.mm-board {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 clamp(8px, 2vw, 28px);
  padding: clamp(12px, 2vh, 22px) clamp(14px, 2.4vw, 30px) clamp(14px, 2.4vh, 26px);
  border: clamp(10px, 1.6vw, 18px) solid #9a6434;
  border-radius: 26px;
  background-color: #cf9a5e;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 70, 25, 0.22) 0 1.4px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255, 230, 190, 0.28) 0 1.2px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(110, 60, 20, 0.2) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 85% 15%, rgba(255, 235, 200, 0.22) 0 1px, transparent 1.8px);
  background-size: 23px 19px, 17px 21px, 29px 25px, 13px 15px;
  box-shadow: inset 0 0 0 3px #7a4a22, inset 0 6px 18px rgba(70, 35, 8, 0.35), 0 10px 26px rgba(60, 30, 5, 0.25);
  box-sizing: border-box;
  overflow: hidden;
}
.mm-title {
  grid-column: 1 / -1;
  justify-self: center;
  margin-bottom: clamp(4px, 1vh, 10px);
  padding: 6px 28px 8px;
  background: #fffdf5;
  box-shadow: 0 4px 10px rgba(60, 30, 5, 0.25);
  transform: rotate(-1.5deg);
  position: relative;
}
.mm-title::before, .mm-title::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 54px;
  height: 18px;
  background: rgba(255, 240, 180, 0.75);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.mm-title::before { left: -14px; transform: rotate(-24deg); }
.mm-title::after { right: -14px; transform: rotate(24deg); }
.mm-title span {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: clamp(1.3rem, 2.8vw, 2.1rem);
  font-weight: 800;
  color: #c2412d;
  letter-spacing: 0.02em;
}

.mm-side {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.4vh, 14px);
}
/* Em arco, "abraçando" o personagem: o do meio mais para fora. */
.mm-side .mm-card:nth-child(1), .mm-side .mm-card:nth-child(5) { --arc: 22%; }
.mm-side .mm-card:nth-child(2), .mm-side .mm-card:nth-child(4) { --arc: 9%; }
.mm-side .mm-card:nth-child(3) { --arc: 0%; }
.mm-side.is-left .mm-card { --shift: var(--arc); }
.mm-side.is-right .mm-card { --shift: calc(var(--arc) * -1); }

.mm-card {
  position: relative;
  min-height: 0;
  width: 78%;
  justify-self: center;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0 10px;
  padding: 10px 14px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--card);
  box-shadow: 0 6px 12px rgba(60, 30, 5, 0.28), inset 0 -10px 18px rgba(0, 0, 0, 0.04);
  color: #5a4632;
  font: inherit;
  cursor: pointer;
  transform: translateX(var(--shift, 0)) rotate(var(--tilt, 0deg));
  transition: transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.mm-card:active { transform: translateX(var(--shift, 0)) rotate(var(--tilt, 0deg)) scale(0.96); }
.mm-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a8a, #d62f2f 60%, #9e1c1c);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.35);
}
.mm-card-number {
  grid-row: 1 / -1;
  width: clamp(30px, 3.6vw, 42px);
  height: clamp(30px, 3.6vw, 42px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 900;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}
.mm-card-mark {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1;
  color: rgba(90, 70, 50, 0.55);
}
.mm-card small { font-weight: 800; font-size: clamp(0.72rem, 1.2vw, 0.92rem); opacity: 0.75; }
.mm-card.is-soon { animation: mm-soon 0.55s ease; }
.mm-card.is-soon::after {
  content: "Em breve!";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 3;
  padding: 6px 14px;
  border-radius: 999px;
  background: #2f6fd6;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: mm-bubble 1.6s ease forwards;
  pointer-events: none;
}
@keyframes mm-soon {
  20% { transform: translateX(var(--shift, 0)) rotate(calc(var(--tilt) - 6deg)); }
  45% { transform: translateX(var(--shift, 0)) rotate(calc(var(--tilt) + 6deg)); }
  70% { transform: translateX(var(--shift, 0)) rotate(calc(var(--tilt) - 3deg)); }
}
@keyframes mm-bubble { 0% { opacity: 0; transform: translate(-50%, 6px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.mm-hero {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 0 46px;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mm-hero .mm-avatar {
  position: relative;
  z-index: 1;
  height: 100%;
  width: auto;
  max-width: 100%;
  filter: drop-shadow(0 8px 10px rgba(60, 30, 5, 0.3));
  transition: transform 0.2s ease;
}
.mm-hero:active .mm-avatar { transform: scale(0.97); }
.mm-hero-glow {
  position: absolute;
  inset: 8% 6% 18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 250, 225, 0.85), rgba(255, 250, 225, 0));
}
.mm-hero-tag {
  position: absolute;
  bottom: 4px;
  left: 50%;
  z-index: 2;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fffdf5;
  color: #c2412d;
  font-weight: 900;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(60, 30, 5, 0.25);
  transform: translateX(-50%);
}
.mm-hero.is-fresh .mm-hero-tag { background: #2fb36f; color: #fff; animation: mm-call 1.4s ease-in-out infinite; }
@keyframes mm-call { 50% { transform: translateX(-50%) scale(1.08); } }
.mm-hero.is-arriving .mm-avatar { animation: mm-arrive 0.7s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes mm-arrive { from { transform: translateY(30px) scale(0.6); opacity: 0; } }

/* ---------- Editor (criação do personagem, estilo jogo) ---------- */
.me-editor {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(124px, 14.5vw, 170px) clamp(88px, 9.5vw, 112px) minmax(0, 1fr) clamp(250px, 31vw, 420px);
  gap: clamp(6px, 1vw, 12px);
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: 26px;
  background: linear-gradient(180deg, #c9d6df 0%, #b5c7cf 45%, #8fb08c 78%, #5f8a5a 100%);
  overflow: hidden;
  box-sizing: border-box;
  color: #f4f6f8;
}
.me-scene { position: absolute; inset: 0; pointer-events: none; }
.me-scene svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; }
.me-sun { position: absolute; left: 50%; top: 8%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 240, 0.9), rgba(255, 255, 240, 0)); transform: translateX(-50%); }

.me-cats, .me-parts, .me-panel {
  position: relative;
  z-index: 1;
  min-height: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(60, 64, 72, 0.88), rgba(42, 46, 54, 0.92));
  box-shadow: 0 10px 24px rgba(10, 20, 30, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.me-cats { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; align-self: stretch; overflow-y: auto; }
.me-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e9edf1;
  font: inherit;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.25vw, 1.05rem);
  text-align: left;
  cursor: pointer;
}
.me-cat span { font-size: 1.5rem; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.me-cat.is-active { background: linear-gradient(90deg, #e07b24, #b8641f); color: #fff; box-shadow: inset 0 0 0 2px #4fa8ff; }
.me-parts { align-self: start; display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; max-height: 100%; overflow-y: auto; }
.me-part {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d9dee4;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.me-part span { font-size: 1.55rem; line-height: 1.1; }
.me-part.is-active { background: linear-gradient(180deg, #e07b24, #b8641f); color: #fff; }

/* Palco: personagem no pedestal com o círculo mágico. */
.me-stage { position: relative; z-index: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.me-stage .mm-stage-avatar { position: relative; z-index: 2; min-height: 0; padding: 4% 4% 7%; box-sizing: border-box; }
.me-stage .mm-stage-avatar .mm-avatar { filter: drop-shadow(0 10px 10px rgba(20, 30, 40, 0.35)); }
.mm-stage-avatar.is-pop .mm-avatar { animation: mm-pop 0.32s ease; }
@keyframes mm-pop { 40% { transform: scale(1.05) translateY(-4px); } }
.me-podium { position: absolute; z-index: 1; left: 50%; bottom: calc(var(--me-bottom, 64px) - 4px); width: min(100%, 420px); aspect-ratio: 400 / 140; transform: translateX(-50%); }
.me-circle { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.me-spin { transform-origin: 200px 70px; animation: me-spin 14s linear infinite; }
.me-spin-back { transform-origin: 200px 70px; animation: me-spin 22s linear infinite reverse; }
@keyframes me-spin { to { stroke-dashoffset: -280; } }
.me-base {
  position: absolute;
  left: 23%;
  right: 23%;
  top: 22%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #ffffff, #dfe3e7 55%, #b9c0c7 100%);
  box-shadow: 0 8px 0 #9aa3ad, 0 14px 18px rgba(0, 0, 0, 0.25);
}
.me-bottom { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 56px; }
.me-name { padding: 6px 20px; border-radius: 999px; background: rgba(42, 46, 54, 0.85); color: #fff; font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-size: clamp(1rem, 1.8vw, 1.35rem); font-weight: 800; }
.me-actions { display: flex; gap: 8px; }
.me-random-all, .mm-done { min-height: 50px; padding: 0 18px; border: 0; border-radius: 14px; font: inherit; font-weight: 900; font-size: 1.05rem; cursor: pointer; }
.me-random-all { background: #3c4048; color: #fff; box-shadow: 0 4px 0 #23262c; }
.mm-done { background: #22a55b; color: #fff; box-shadow: 0 4px 0 #17803f; }
.me-random-all:active, .mm-done:active { transform: translateY(3px); box-shadow: none; }

/* Painel da direita: miniaturas e cores. */
.me-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.me-panel header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 2px solid rgba(255, 255, 255, 0.08); }
.me-panel header strong { color: #ffb066; font-size: 1.15rem; font-weight: 900; border-bottom: 3px solid #e07b24; padding-bottom: 2px; }
.me-dice { width: 46px; height: 46px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.12); font-size: 1.5rem; cursor: pointer; }
.me-dice:active { transform: rotate(-20deg) scale(0.92); }
.mm-rows { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 10px 12px 16px; }
.mm-row + .mm-row { margin-top: 14px; }
.mm-row h4 { margin: 0 0 8px; color: #c9d1d9; font-size: 0.95rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; }
.mm-note { margin: 0; color: #aab3bd; font-weight: 700; }
.mm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mm-tile {
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 6px 4px 6px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #d9dee4;
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.mm-tile:active { transform: scale(0.95); }
.mm-tile-art { width: 100%; aspect-ratio: 1; border-radius: 10px; background: radial-gradient(circle at 50% 40%, #8c96a3, #5d6672); overflow: hidden; }
.mm-tiles.is-tall .mm-tile-art { aspect-ratio: 3 / 4; }
.mm-tile small { font-weight: 800; font-size: 0.78rem; line-height: 1.1; text-align: center; }
.mm-tile.is-selected { background: rgba(79, 168, 255, 0.18); box-shadow: 0 0 0 3px #4fe0ff, 0 0 16px rgba(79, 224, 255, 0.55); }
.mm-tile.is-selected small { color: #ffffff; }
.mm-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.mm-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.mm-swatch.is-selected { box-shadow: 0 0 0 4px #4fe0ff, 0 0 14px rgba(79, 224, 255, 0.7); transform: scale(1.1); }

/* Em pé: quadros em cima e embaixo; no editor o personagem fica em cima e a tabela embaixo. */
@media (orientation: portrait) {
  .mm-board { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .mm-side { grid-template-rows: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mm-side .mm-card { --shift: 0; width: 100%; grid-template-columns: 1fr; justify-items: center; }
  .mm-card-number { grid-row: auto; }
  .mm-card-mark { display: none; }
  .me-editor { grid-template-columns: clamp(96px, 16vw, 130px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.9fr); }
  .me-cats { grid-row: 1 / 3; }
  .me-parts { grid-column: 2; grid-row: 1; flex-direction: row; align-self: stretch; overflow-x: auto; }
  .me-stage { grid-column: 2; grid-row: 2; }
  .me-panel { grid-column: 1 / -1; grid-row: 3; }
}

/* Quadro pronto no mural (emoji, nome e quantas cartas). */
.mm-card.is-ready { grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; row-gap: 0; box-shadow: 0 6px 12px rgba(60, 30, 5, 0.28), 0 0 0 3px #ffffff inset; }
.mm-card.is-ready .mm-card-mark.is-emoji { color: inherit; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.mm-card-title { font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-weight: 800; font-size: clamp(0.95rem, 1.6vw, 1.2rem); color: #3a2a1a; }
.mm-card.is-ready small { color: #17803f; opacity: 1; }

/* ---------- Quadro 1: Objetivos (scripts/features/my-mural-goals.js) ---------- */
.mg-root {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.4vh, 14px);
  padding: clamp(10px, 1.6vh, 16px);
  border-radius: 26px;
  background: #fbf3e4;
  box-shadow: inset 0 0 0 4px #e5d3b3;
  box-sizing: border-box;
  position: relative;
}
.mg-root[data-mode="escrever"] { grid-template-rows: auto auto minmax(0, 1fr); }
.mg-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mg-top h2 { margin: 0; font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-size: clamp(1.2rem, 2.2vw, 1.7rem); color: #c2412d; }
.mg-back, .mg-tool {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: #6b4a2b;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 3px 0 #e2cfae;
  cursor: pointer;
}
.mg-modes { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: #eadbc0; margin-left: auto; }
.mg-mode { min-height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #6b4a2b; font: inherit; font-weight: 900; cursor: pointer; }
.mg-mode.is-active { background: #6c4fd6; color: #ffffff; }
.mg-tools { display: flex; gap: 6px; }

/* Uma por vez: carta grande + pergunta. */
.mg-ask {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  min-height: 0;
}
.mg-big-card {
  justify-self: center;
  width: min(100%, 260px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 0 0 4px #6c4fd6, 0 10px 20px rgba(60, 30, 5, 0.18);
  transform: rotate(-2deg);
  cursor: pointer;
  animation: mg-card-in 0.4s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes mg-card-in { from { transform: rotate(-12deg) scale(0.6); opacity: 0; } }
.mg-big-card span { font-size: clamp(2.6rem, 6vh, 4rem); line-height: 1; }
.mg-big-card b { font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: #3a2a1a; text-align: center; padding: 0 10px; }
.mg-question p { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: clamp(1.25rem, 2.6vw, 1.9rem); font-weight: 900; color: #3a2a1a; }
.mg-say { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: #2f6fd6; color: #fff; font-size: 1.3rem; cursor: pointer; }
.mg-answers { display: flex; gap: 12px; flex-wrap: wrap; }
.mg-answer { min-height: 64px; min-width: 150px; padding: 0 24px; border: 0; border-radius: 20px; font: inherit; font-size: 1.4rem; font-weight: 900; color: #fff; cursor: pointer; }
.mg-answer.is-yes { background: #22a55b; box-shadow: 0 5px 0 #17803f; }
.mg-answer.is-no { background: #e5484d; box-shadow: 0 5px 0 #b42323; }
.mg-answer:active { transform: translateY(4px); box-shadow: none; }
.mg-ask-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: #8a6a44; font-weight: 800; }
.mg-skip { border: 0; background: transparent; color: #6c4fd6; font: inherit; font-weight: 900; cursor: pointer; padding: 6px 4px; }
.mg-ask.is-done { grid-template-columns: 1fr; justify-items: center; }
.mg-done-text { display: grid; gap: 4px; text-align: center; font-size: 1.3rem; font-weight: 800; color: #3a2a1a; }
.mg-done-text b { font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-size: 2rem; color: #17803f; }
.mg-flying { position: fixed; z-index: 9999; margin: 0; transition: transform 0.55s cubic-bezier(0.5, 0, 0.6, 1), opacity 0.55s ease; transform-origin: center; pointer-events: none; }

/* Monte (arrastar) e dica (escrever). */
.mg-deck {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  max-height: 30vh;
  overflow-y: auto;
  padding: 10px;
  border-radius: 18px;
  background: #fffaf0;
  box-shadow: inset 0 0 0 3px #eadbc0;
  touch-action: pan-y;
}
.mg-deck.is-over { box-shadow: inset 0 0 0 4px #6c4fd6; }
.mg-empty, .mg-write-tip { margin: 0; color: #8a6a44; font-weight: 800; }

.mg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px 12px 4px 8px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: #3a2a1a;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 2px 0 #e2cfae, 0 3px 8px rgba(60, 30, 5, 0.1);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mg-chip span { font-size: 1.3rem; }
.mg-chip.is-selected { box-shadow: 0 0 0 4px #6c4fd6; }
.mg-chip.is-dragging { opacity: 0.3; }
.mg-chip:disabled { cursor: default; opacity: 1; }
.mg-root[data-mode="um"] .mg-chip { cursor: default; touch-action: auto; }
.mg-ghost { position: fixed; z-index: 9999; margin: 0; pointer-events: none; transform: rotate(-4deg) scale(1.08); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25); }

/* Tabela de 4 colunas. */
.mg-table { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mg-col {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 18px;
  background: color-mix(in srgb, var(--col) 12%, #ffffff);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--col) 45%, #ffffff);
  overflow: hidden;
}
.mg-col.is-over { box-shadow: inset 0 0 0 5px var(--col); }
.mg-col.is-receiving { animation: mg-receive 0.5s ease; }
@keyframes mg-receive { 40% { transform: scale(1.03); box-shadow: inset 0 0 0 6px var(--col); } }
.mg-col header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 54px;
  padding: 6px 10px;
  background: var(--col);
  color: #ffffff;
}
.mg-col header span { font-size: 1.2rem; }
.mg-col header strong { font-size: clamp(0.82rem, 1.3vw, 1rem); line-height: 1.15; font-weight: 900; }
.mg-col header small { min-width: 28px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); font-weight: 900; text-align: center; }
.mg-col-body { min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 8px; touch-action: pan-y; }
.mg-col-body .mg-chip { min-height: 38px; font-size: 0.9rem; }
.mg-write-open { width: 100%; min-height: 44px; border: 2px dashed var(--col); border-radius: 14px; background: rgba(255, 255, 255, 0.7); color: var(--col); font: inherit; font-weight: 900; cursor: pointer; }
.mg-write { display: flex; gap: 4px; width: 100%; }
.mg-write input, .mg-new input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 2px solid #d9c7a6; border-radius: 12px; font: inherit; font-size: 1rem; }
.mg-write button, .mg-new button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: #22a55b; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }

/* Janelas: cartas e tabelas. */
.mg-panel { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 12px; border-radius: 26px; background: rgba(40, 25, 10, 0.45); }
.mg-panel-card { width: min(620px, 100%); max-height: 100%; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 10px; padding: 16px; border-radius: 22px; background: #ffffff; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3); overflow: hidden; }
.mg-panel-card.is-wide { width: min(900px, 100%); grid-template-rows: auto auto auto auto minmax(0, 1fr); overflow-y: auto; }
.mg-panel-card > header { display: flex; align-items: center; justify-content: space-between; }
.mg-panel-card > header strong { font-size: 1.3rem; color: #4b3bb5; }
.mg-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1ecff; color: #4b3bb5; font-size: 1.5rem; cursor: pointer; }
.mg-panel-tip { margin: 0; color: #6b5a44; font-weight: 700; }
.mg-new { display: flex; gap: 6px; }
.mg-panel-body { min-height: 0; overflow-y: auto; }
.mg-panel-body section + section { margin-top: 10px; }
.mg-panel-body h4 { margin: 0 0 6px; color: #4b3bb5; }
.mg-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-toggle-wrap { display: inline-flex; align-items: center; }
.mg-toggle { min-height: 38px; padding: 0 12px; border: 2px solid #d9d2c6; border-radius: 12px; background: #f4f1ec; color: #9a8f80; font: inherit; font-weight: 800; text-decoration: line-through; cursor: pointer; }
.mg-toggle.is-on { border-color: #6c4fd6; background: #f6f2ff; color: #3a2a1a; text-decoration: none; }
.mg-remove { width: 30px; height: 30px; margin-left: -6px; border: 0; border-radius: 50%; background: #e5484d; color: #fff; font-weight: 900; cursor: pointer; }
.mg-new-table { justify-self: start; min-height: 46px; padding: 0 18px; border: 0; border-radius: 14px; background: #6c4fd6; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.mg-new-table:disabled { opacity: 0.4; cursor: default; }
.mg-past-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-past { min-height: 40px; padding: 0 12px; border: 2px solid #e2d6f8; border-radius: 12px; background: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.mg-past.is-open { border-color: #6c4fd6; background: #f6f2ff; }
.mg-past small { color: #8a7a64; }
.mg-past-view p { margin: 0 0 6px; font-weight: 800; color: #4b3bb5; }
.mg-past-view .mg-table { min-height: 220px; }

@media (orientation: portrait) {
  .mg-ask { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .mg-question p, .mg-answers, .mg-ask-foot { justify-content: center; }
  .mg-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* × para tirar uma característica (jeito "Escrever"). */
.mg-chip-x { display: grid; place-items: center; width: 24px; height: 24px; margin-left: 2px; border-radius: 50%; background: #f1e6d6; color: #8a5a3b; font-size: 1.05rem; font-weight: 900; line-height: 1; cursor: pointer; }
.mg-chip-x:active { background: #e5484d; color: #fff; }
