/*
 * Shared Thai ink-safety contract for every Lego game surface.
 * Thai vowels and tone marks can extend above and below the nominal glyph box;
 * controls must reserve real block space instead of vertically centering with a
 * fixed line-height equal to the control height.
 */
:root {
  --lego-thai-safe-line-height: 1.65;
  --lego-thai-safe-input-min-height: 60px;
  --lego-thai-safe-input-padding-top: 12px;
  --lego-thai-safe-input-padding-bottom: 10px;
}

/* Current and future Thai typing bars in Lego. */
body[data-gsh-game="lego"] input[lang="th"],
body[data-lego-builder="true"] input[lang="th"],
body[data-lego-sentence-structure="true"] input[lang="th"] {
  box-sizing: border-box !important;
  min-height: var(--lego-thai-safe-input-min-height) !important;
  height: auto;
  padding-top: var(--lego-thai-safe-input-padding-top) !important;
  padding-bottom: var(--lego-thai-safe-input-padding-bottom) !important;
  font-family: "Sarabun", "Noto Sans Thai", sans-serif;
  line-height: var(--lego-thai-safe-line-height) !important;
}

/* Thai answer cards in the time games. */
body[data-gsh-game="lego"] .ltt-choices[lang="th"] .ltt-choice {
  box-sizing: border-box;
  min-height: var(--lego-thai-safe-input-min-height);
  padding-top: var(--lego-thai-safe-input-padding-top);
  padding-bottom: var(--lego-thai-safe-input-padding-bottom);
  line-height: var(--lego-thai-safe-line-height);
  overflow: visible;
}

/* Formula blocks share one protected control geometry across every family. */
body[data-gsh-game="lego"] :is(.lfp-builder, .lfb-builder-host) :is(select, input) {
  box-sizing: border-box;
  min-height: 48px;
  padding-top: 10px;
  padding-bottom: 6px;
  line-height: var(--lego-thai-safe-line-height);
  overflow: visible;
}
body[data-gsh-game="lego"] :is(.lfp-builder, .lfb-builder-host) select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 26px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M2 2l5 5 5-5' fill='none' stroke='%235a3e0a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px 9px;
}
body[data-gsh-game="lego"] :is(.lfp-builder, .lfb-builder-host) select:disabled {
  background-image: none;
}

/* Builder values and Thai-entry controls use the same vertical ink allowance. */
body[data-lego-builder="true"] :is(.thai-output, .piece-value, .option-main, .subject-plural-thai) {
  line-height: var(--lego-thai-safe-line-height);
}
body[data-lego-builder="true"] :is(.picker-search input, .create-form input, .create-form select) {
  box-sizing: border-box;
  min-height: 50px;
  padding-top: 10px;
  padding-bottom: 8px;
  line-height: 1.55;
}
