/* "+ Foto do aparelho" na escolha de estímulos (scripts/features/photo-stimuli.js). */

/* Primeira tela: "+ Foto do aparelho" (sem fotos ainda) ocupa a largura toda, embaixo de Reais e Desenhos. */
#stimulusPickerModal .stimulus-kind-card.photo-stimulus-card {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  justify-items: start;
  align-items: center;
  column-gap: 18px;
  row-gap: 2px;
  border: 3px dashed #93c5fd;
  background: #eff6ff;
  text-align: left;
}

#stimulusPickerModal .photo-stimulus-icon {
  display: grid;
  place-items: center;
  color: #2563eb;
}

#stimulusPickerModal .photo-stimulus-card .photo-stimulus-icon {
  grid-row: 1 / 3;
  width: clamp(64px, 8vw, 84px);
  height: clamp(64px, 8vw, 84px);
  aspect-ratio: 1;
}

#stimulusPickerModal .photo-stimulus-icon svg {
  width: 70%;
  height: 70%;
}

#stimulusPickerModal .photo-stimulus-card strong {
  color: #1d4ed8;
}

/* Com fotos: "Minhas fotos" é a 3ª opção, lado a lado com Reais e Desenhos. */
#stimulusPickerModal .modal-stimulus-list.is-kind-grid.has-photos-kind {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#stimulusPickerModal .stimulus-kind-card[data-kind="photos"] {
  border-color: #bfdbfe;
  background: #eff6ff;
}

/* Dentro de "Minhas fotos": o quadro de pôr mais uma foto. */
#stimulusPickerModal .stimulus-picker-item.photo-stimulus-add {
  border: 3px dashed #93c5fd;
  background: #eff6ff;
  font: inherit;
  color: inherit;
}

#stimulusPickerModal .photo-stimulus-add .stimulus-picker-picture {
  background: transparent;
}

#stimulusPickerModal .photo-stimulus-add strong {
  color: #1d4ed8 !important;
}

/* Discriminação Livre: botão na janela da célula. */
.fd-picker-photo {
  min-height: 42px;
  padding: 0 14px;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

/* Botão "Apagar" nas fotos da pasta "minhas fotos". */
#stimulusPickerModal .photo-stimulus-delete {
  min-height: 34px;
  padding: 4px 14px;
  border: 2px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #b91c1c;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* Janela da foto. */
.photo-stimulus-backdrop {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.photo-stimulus-dialog {
  display: grid;
  gap: 14px;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.photo-stimulus-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.photo-stimulus-dialog h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
}

.photo-stimulus-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  font-size: 1.6rem;
  cursor: pointer;
}

.photo-stimulus-preview {
  display: grid;
  place-items: center;
  height: clamp(180px, 32dvh, 280px);
  border: 3px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
}

.photo-stimulus-preview:has(img) {
  border-style: solid;
  border-color: #3b82f6;
  background: #fff;
}

.photo-stimulus-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-stimulus-sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-stimulus-sources button {
  min-height: 52px;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}

.photo-stimulus-name {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.photo-stimulus-name span {
  font-size: 0.95rem;
  color: #475569;
}

.photo-stimulus-name input {
  min-height: 50px;
  padding: 8px 14px;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  font: inherit;
  font-size: 1.1rem;
}

.photo-stimulus-name input:focus {
  border-color: #3b82f6;
  outline: none;
}

.photo-stimulus-note {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.photo-stimulus-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
}

.photo-stimulus-save {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.photo-stimulus-save:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Palavras da conta (scripts/features/account-words.js). */
.syllable-picker-groups.has-word-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.syllable-group-card.account-words-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.syllable-group-card.account-word-add {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  box-shadow: none;
}

.syllable-group-card.account-word-add strong {
  color: #1d4ed8;
}

.account-word-syllables {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  padding: 10px;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.account-word-syllables b {
  padding: 6px 14px;
  border-radius: 12px;
  background: #fff;
  color: #1d4ed8;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 0 #cbd5e1;
}

.account-word-syllables i {
  color: #94a3b8;
  font-style: normal;
  font-size: 1.4rem;
}

.account-word-figure {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.account-word-figure-preview {
  display: grid;
  place-items: center;
  height: 120px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.9rem;
  overflow: hidden;
}

.account-word-figure-preview:has(img) {
  border-style: solid;
  border-color: #3b82f6;
}

.account-word-figure-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.account-word-figure-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-word-figure-actions button {
  min-height: 46px;
  padding: 6px 10px;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.account-word-figure-actions button:first-child {
  grid-column: 1 / -1;
}

.account-word-figure-actions button.is-plain {
  border-color: #e2e8f0;
  background: #fff;
  color: #475569;
}

/* Frases da conta (scripts/features/account-sentences.js). */
#stimulusPickerModal .account-sentence-card {
  border: 3px dashed #93c5fd;
  background: #eff6ff;
}

#stimulusPickerModal .account-sentence-card strong {
  color: #1d4ed8;
}

#stimulusPickerModal .account-sentence-icon {
  display: grid;
  place-items: center;
  color: #2563eb;
  font-size: 3rem;
  font-weight: 900;
}

.account-sentence-pieces {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
  padding: 10px;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.account-sentence-pieces > span {
  align-self: center;
}

.account-sentence-piece {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 64px;
  min-height: 64px;
  padding: 6px 12px;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

/* O app tem figura para esta palavra: um pontinho azul avisa. */
.account-sentence-piece.has-suggestion::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3b82f6;
}

.account-sentence-piece.is-image {
  grid-template-rows: 1fr auto;
  gap: 2px;
  width: 84px;
  padding: 4px;
  border-color: #3b82f6;
}

.account-sentence-piece.is-image img {
  width: 100%;
  height: 56px;
  object-fit: contain;
}

.account-sentence-piece.is-image small {
  font-size: 0.7rem;
  color: #475569;
}

.account-sentence-piece.is-open {
  box-shadow: 0 0 0 4px #fde047;
}

.account-sentence-menu {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #fefce8;
}

.account-sentence-menu strong {
  color: #1f2937;
}

.account-sentence-menu .has-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-sentence-menu .has-thumb img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.account-word-syllables .account-word-mono {
  flex-basis: 100%;
  color: #92400e;
  font-size: 0.85rem;
  text-align: center;
}
