.crossword-rules {
  margin: 0.75rem 0 0;
  max-width: 40rem;
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.crossword-rules__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.crossword-rules ul {
  margin: 0;
  padding-left: 1.2rem;
}

.crossword-rules li + li {
  margin-top: 0.2rem;
}

.crossword-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.crossword-board-wrap {
  position: relative;
}

.crossword-board {
  display: grid;
  gap: 2px;
  width: max-content;
  padding: 2px;
  background: #1a1a1a;
  user-select: none;
}

.crossword-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  background: #fff;
  border: 0;
  padding: 0;
  font: inherit;
  color: #111;
  cursor: pointer;
}

.crossword-cell--block {
  background: #1a1a1a;
  cursor: default;
}

.crossword-cell--given {
  font-weight: 700;
  background: #f3f3f3;
}

.crossword-cell--word {
  background: #eef4fc;
}

.crossword-cell--selected {
  outline: 2px solid #2a6fdb;
  outline-offset: -2px;
  z-index: 1;
  background: #dde9fb;
}

.crossword-cell--wrong {
  color: #b00020;
  background: #f8d7da;
  box-shadow: inset 0 0 0 2px #b00020;
}

.crossword-cell--ok {
  background: #e6f5ea;
}

.crossword-cell__num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.55rem;
  line-height: 1;
  color: #555;
  font-weight: 600;
}

.crossword-cell__ch {
  font-size: 1.05rem;
  font-weight: 650;
  text-transform: uppercase;
  line-height: 1;
}

.crossword-catch {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  left: 0;
  top: 0;
}

.crossword-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: min(100%, 18rem);
  flex: 1 1 16rem;
  max-width: 28rem;
}

.crossword-clues h3 {
  margin: 0.6rem 0 0.3rem;
  font-size: 1rem;
}

.crossword-clues h3:first-child {
  margin-top: 0;
}

.crossword-clue {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.28rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
}

.crossword-clue:hover,
.crossword-clue:focus-visible {
  background: #f3f6fb;
}

.crossword-clue--active {
  background: #e7f0ff;
}

.crossword-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .crossword-cell {
    width: 1.45rem;
    height: 1.45rem;
  }

  .crossword-cell__ch {
    font-size: 0.85rem;
  }

  .crossword-cell__num {
    font-size: 0.45rem;
  }
}
