/* Codeword */

.cwd-status {
  text-align: center;
  font-weight: 700;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.cwd-status--win { color: var(--color-success); background: rgba(74, 222, 128, 0.12); }
.cwd-status--lose { color: var(--color-accent); background: rgba(238, 111, 168, 0.12); }
.cwd-status--msg { color: var(--color-text); background: var(--color-bg-alt); }

.cwd-grid {
  display: grid;
  gap: 3px;
  justify-content: center;
  max-width: 100%;
  max-height: 380px;
  overflow: auto;
  margin: 0 auto 18px;
}

.cwd-cell {
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-alt);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.cwd-cell--block { background: transparent; border: none; cursor: default; }
.cwd-cell--selected { border-color: var(--color-primary); background: rgba(79, 216, 224, 0.15); }
.cwd-cell--free { background: rgba(74, 222, 128, 0.15); }

.cwd-cell-letter {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
.cwd-cell-num {
  font-size: 0.5rem;
  color: var(--color-text-soft);
  position: absolute;
  bottom: 1px;
  right: 2px;
}

.cwd-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 18px;
}

.cwd-legend-cell {
  width: 30px;
  border: none;
  border-radius: 6px;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  cursor: pointer;
}
.cwd-legend-cell--selected { background: rgba(79, 216, 224, 0.2); outline: 1px solid var(--color-primary); }
.cwd-legend-cell--free { background: rgba(74, 222, 128, 0.15); cursor: default; }
.cwd-legend-num { font-size: 0.65rem; color: var(--color-text-soft); }
.cwd-legend-guess { font-size: 0.9rem; font-weight: 700; color: var(--color-text); min-height: 18px; text-transform: uppercase; }

.cwd-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.cwd-controls .btn:disabled { opacity: 0.4; cursor: default; }

/* Phones: the puzzle grid used to be fixed 34px cells and widened the whole page. The cells now share the available width. */
@media (max-width: 480px) {
  .cwd-grid { width: 100%; max-width: max-content; }
  .cwd-cell { width: auto; height: auto; aspect-ratio: 1 / 1; min-width: 0; }
}
