/* ZerekBala layout and topic-image controls — 2026-08-27 */
#dictionary .dictionary-grid,
#topics .cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#topics .word-card {
  min-width: 0;
}

#dictionary .dictionary-emoji.dictionary-illustration {
  display: block;
  width: 100%;
  height: clamp(210px, 18vw, 235px);
  min-height: clamp(210px, 18vw, 235px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#topics .word-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(195px, 17vw, 220px);
  font-size: clamp(112px, 11vw, 145px);
  line-height: 1;
}

#topics .word-emoji.topic-image {
  min-height: clamp(195px, 17vw, 220px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.topic-image-actions {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 7px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #ebe7de;
}

.topic-upload-button,
.topic-restore-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 35px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
}

.topic-upload-button {
  color: #fff;
  background: #7557ff;
}

.topic-upload-button.is-busy {
  opacity: .65;
  cursor: wait;
}

.topic-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.topic-restore-button {
  color: #6951d8;
  background: #f0edfa;
}

.topic-image-notice {
  margin: 0 0 14px;
  border: 1px solid #d9d2ff;
  border-radius: 12px;
  padding: 10px 13px;
  color: #4f3caa;
  background: #f5f2ff;
  font-size: 12px;
  font-weight: 800;
}

.topic-image-notice.is-error {
  border-color: #e94d58;
  color: #a52d36;
  background: #fff0f0;
}

@media (max-width: 900px) {
  #dictionary .dictionary-grid,
  #topics .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dictionary .dictionary-emoji.dictionary-illustration {
    height: 205px;
    min-height: 205px;
  }

  #topics .word-emoji,
  #topics .word-emoji.topic-image {
    min-height: 195px;
  }
}

@media (max-width: 560px) {
  #dictionary .dictionary-grid,
  #topics .cards {
    grid-template-columns: 1fr;
  }

  #dictionary .dictionary-emoji.dictionary-illustration {
    height: 210px;
    min-height: 210px;
  }

  #topics .word-emoji,
  #topics .word-emoji.topic-image {
    min-height: 200px;
  }
}
