/* Keyboard grid: 10 columns to match user's keyboard layout */

.container {
  /* Keyboard-like layout: 10 columns, keys flow left-to-right */
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 56px;
  gap: 8px;
  padding: 20px;
  max-width: 760px;
  margin: 0 auto;
  align-items: center;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  max-width: 300px;
  min-height: 72px;
  margin: 20px auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(2, 6, 23, 0.03);
  /* allow the box to grow vertically and wrap words instead of showing a scrollbar */
  overflow: visible;
  align-items: flex-start;
  /* allow long words to break/wrap instead of causing overflow */
}

/* Make contenteditable choices behave like plain editor text */
.choices {
  text-transform: lowercase;
  caret-color: #111827;
  /* use a cursive (script) font for the editor text */
  font-family: 'Dancing Script', cursive;
  /* larger, more readable script size */
  font-size: 28px;
}

.choices:focus {
  outline: 2px solid rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

/* Placeholder text when empty (shows only if truly empty) */
.choices:empty::before {
  content: "Type ...";
  color: #94a3b8;
  font-style: italic;
  padding-left: 4px;
}

/* Inline AZERTY visual style for keys */
.container>button.key {
  background-color: #dbeefe;
  color: #0b3b5a;
  border-radius: 6px;
  min-width: 48px;
  height: 48px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  font-family: Arial, sans-serif;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border: none;
}

.container>button.key:hover {
  background-color: #d6e3ef;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.container>button.key.pressed {
  /* brief pressed visual for ~200ms */
  background-color: #cbd5e1;
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) inset;
}

.container>button.space {
  /* wide space-like key: occupy first 9 columns (ESP) */
  grid-column: 1 / span 9;
  border-radius: 8px;
}

.container>button.del {
  /* delete key: occupy the final column (1 column wide) */
  grid-column: 10 / span 1;
  border-radius: 8px;
}

/* Appended choice chips (spans) */
.choices>.choice {
  /* Plain inline text tokens: no padding, flow like editor words */
  background: transparent;
  color: inherit;
  border-radius: 0;
  min-width: 0;
  height: auto;
  padding: 0;
  margin-right: 0;
  display: inline;
  vertical-align: baseline;
  font-size: inherit;
  font-weight: 400;
  font-family: inherit;
  cursor: text;
  border: none;
  box-shadow: none;
  text-transform: lowercase;
}

body {
  background-color: #f5f5f5;
  margin: 0;
  padding: 20px;
}