:root {
  --main-font-size: 1.25em;
  --main-font-weight: bold;
}

body {
  font-family: sans-serif;
  font-size: var(--main-font-size);
  font-weight: var(--main-font-weight);
}

/* Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(8, auto);
  gap: 8px;
}

/* All cells share the same base font size and weight */
.grid-cell {
  min-height: 3em;
  position: relative;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  background-color: #f8f8f8;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--main-font-size);
  font-weight: var(--main-font-weight);
}

/* Special cells (same size, special color) */
.grid-cell.muwords {
  background-color: #004d00;
  color: white;
  pointer-events: none;
}

.grid-cell.settings {
  background-color: #002b80;
  color: lightgray;
  pointer-events: none;
}

/* Reactive cells alternating colors */
.grid-cell.reactive.row-even {
  background-color: #ffffff;
}

.grid-cell.reactive.row-odd {
  background-color: #e0f7fa;
}

/* Visual feedback on interaction */
.grid-cell.reactive.highlight {
  background-color: #d0f0ff !important;
}

.grid-cell.reactive.long-press {
  background-color: #ffe0cc !important;
}

.grid-cell.reactive:hover {
  outline: 2px solid #aaa;
}

/* Inside each cell */
.word-combo {
  display: inline-flex;
  gap: 0.3em;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  font-size: inherit;
  font-weight: inherit;
}

.next-prefix {
  color: red;
  text-transform: lowercase;
  font-size: inherit;
  font-weight: inherit;
}

/* Key label */
.key-indicator {
  color: red;
  font-size: 0.75em; /* keep small for distinction */
  font-weight: bold;
  position: absolute;
  top: 4px;
  left: 6px;
  text-align: left;
}

/* Text box styling */
.text-box {
  width: 100%;
  padding: 8px;
  font-size: var(--main-font-size);
  margin-top: 16px;
}

/* Grid shell */
#grid-container {
  width: 100%;
  background-color: #ccc;
  padding: 8px;
  border: 2px solid #ccc;
  box-sizing: border-box;
}

#grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(8, auto);
  gap: 4px;
  width: 100%;
}
