@import 'chrome.css';
/* Desafio (14 e 15): o toque segue com 48px. Letra menor só na tela grande; no tablet a grade rola dentro dela. */
.word-grid.word-grid-big {
  grid-template-columns: repeat(var(--size), 48px);
  justify-content: start;
  overflow-x: auto;
  max-width: 100%;
}
:is(.student-workspace, .skin-preview[data-skin]) dialog .word-grid.word-grid-big {
  gap: 4px;
}
:is(.student-workspace, .skin-preview[data-skin]) dialog .word-grid.word-grid-big button {
  min-height: 48px;
  font-size: 20px;
  border-radius: 8px;
}
.word-grid.word-grid-big button {
  min-height: 48px;
}
.wizard-phone .word-grid.word-grid-big {
  grid-template-columns: repeat(var(--size), 18px);
  justify-content: center;
  gap: 2px;
}
.wizard-phone .word-grid.word-grid-big button {
  width: 18px;
  height: 18px;
  min-height: 0;
  font-size: 10px;
}
@media (min-width: 1024px) {
  .word-grid.word-grid-big {
    justify-content: center;
    max-width: min(100%, 900px);
  }
}
#dialog:has(.listening-target) > .question {
  font-size: 20px;
  line-height: 1.4;
  padding: 16px;
  margin: 12px 0;
}
#dialog:has(.listening-target) > .question {
  font-size: 18px;
  line-height: 1.35;
  padding: 10px 14px;
  margin: 8px 0;
}
#dialog .listening-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 14px;
  margin: 8px 0;
  border-radius: 14px;
  background: var(--app-tint);
}
#dialog .listening-target > span {
  margin: 0;
  font-weight: 700;
}
#dialog .listening-target p {
  margin: 0;
  flex-basis: 100%;
  font-size: 14px;
  color: var(--app-muted);
}
#dialog .listening-target button {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
}
#dialog:has(.listening-target) .word-grid {
  margin: 12px auto;
}
#dialog:has(.listening-target) #game-message {
  margin: 8px 0;
}
/* O acento da atividade (ajuste só aqui): por padrão, o mesmo verde de antes. */
.word-grid {
  --module-accent: var(--app-accent, #1f6f50);
}
/* A grade sempre cabe na tela: o lado da célula vem do JS (--cell), sem barra de rolagem (ver fitWordGrid). */
#dialog .word-grid.fit button {
  width: var(--cell);
  height: var(--cell);
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0;
  font-size: calc(var(--cell) * 0.46);
}
/* Tabuleiro com textura leve de newsprint, mas seguindo o TEMA da pessoa (tokens --app-*).
   As peças de letra ficam por cima; as palavras achadas destacam na cor do módulo. */
#dialog .word-grid {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 12px;
  color: var(--app-ink);
  background-color: var(--app-surface);
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1.5px),
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), rgba(0, 0, 0, 0.035) calc(100% / 6));
  background-size:
    6px 6px,
    auto;
  border: 1px solid var(--app-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.12);
}
#dialog .word-grid::before {
  content: 'PALAVRAS';
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  font:
    800 clamp(44px, 13vw, 132px) / 1 'Times New Roman',
    Georgia,
    serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-ink);
  opacity: 0.05;
  transform: rotate(-4deg);
  pointer-events: none;
}
#dialog .word-grid button {
  position: relative;
  z-index: 1;
  color: var(--app-ink);
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.08s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}
#dialog .word-grid button:hover:not(.found) {
  border-color: var(--module-accent);
}
#dialog .word-grid button.found {
  color: #fff;
  background: var(--module-accent) !important;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
#dialog .word-grid button.just-found {
  animation: ws-pop 0.45s ease;
  z-index: 1;
}
@keyframes ws-pop {
  0% {
    transform: scale(0.5);
  }
  55% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  #dialog .word-grid button.just-found {
    animation: none;
  }
}
/* A letra tocada fica marcada até o segundo toque (dono, 17/10): contorno grosso e fundo, não só cor, nas três skins;
   no alto contraste, as cores do sistema. Sem animação, para respeitar «reduzir movimento». */
.word-grid button.selected {
  position: relative;
  outline: 4px solid var(--module-accent);
  outline-offset: -4px;
  background: var(--app-tint, #e8f2ec) !important;
  font-weight: 800;
}
/* O «1» no canto diz que é a primeira letra escolhida: uma marca que não depende de cor. */
.word-grid button.selected::after {
  content: '1';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
@media (forced-colors: active) {
  .word-grid button.selected {
    outline: 4px solid Highlight;
    background: Highlight !important;
    color: HighlightText;
  }
}

/* --- Layout do player: tabuleiro (recorte de jornal) + caderno com lápis, lado a lado; empilha no estreito. --- */
#dialog .ws-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(148px, 22%, 196px);
  gap: 16px;
  align-items: start;
}
@media (max-width: 720px) {
  #dialog .ws-stage {
    grid-template-columns: 1fr;
  }
}
#dialog .ws-board-wrap {
  min-width: 0;
}
#dialog .ws-notebook {
  position: relative;
  border-radius: 10px 10px 12px 12px;
  background:
    linear-gradient(#fff, #fff) left / 28px 100% no-repeat,
    repeating-linear-gradient(#fcfcf8 0 25px, #e2ecf3 25px 26px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 10px 10px 14px 36px;
  min-height: 110px;
}
#dialog .ws-notebook::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9a6a6;
}
#dialog .ws-notebook::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 12px;
  background: radial-gradient(circle at 50% 50%, #b9b0a0 0 3.5px, transparent 4.5px) left top / 12px 22px repeat-y;
}
#dialog .ws-notebook h3 {
  margin: 0 0 6px;
  font: 700 12px/1 system-ui;
  color: #42506a;
}
#dialog .ws-notebook ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
#dialog .ws-notebook li {
  font-family: 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive;
  font-size: 16px;
  line-height: 25px;
  min-height: 24px;
  display: flex;
  align-items: center;
  color: #28406e;
}
#dialog .ws-notebook li.done {
  color: var(--module-accent);
}
#dialog .ws-notebook li.done::before {
  content: '✓';
  font-family: system-ui;
  font-weight: 800;
  margin-right: 6px;
}
#dialog .ws-notebook li.just-written {
  animation: ws-write 0.5s ease;
}
@keyframes ws-write {
  0% {
    opacity: 0;
    transform: translateX(-6px) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
#dialog .ws-notebook .scribble {
  height: 12px;
  width: var(--w, 68%);
  border-radius: 7px;
  background: repeating-linear-gradient(
    102deg,
    rgba(74, 84, 100, 0.55) 0 8px,
    rgba(74, 84, 100, 0.2) 8px 15px,
    rgba(74, 84, 100, 0.5) 15px 23px
  );
  filter: blur(2.2px);
  opacity: 0.5;
  transform: rotate(-0.6deg);
}
#dialog .ws-notebook .ws-pencil {
  position: absolute;
  right: -2px;
  bottom: -6px;
  font-size: 36px;
  transform: rotate(38deg);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.22));
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #dialog .ws-notebook li.just-written {
    animation: none;
  }
}
