#app {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.board-wrap {
  width: 100%;
  max-width: 620px;
}

.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.clue-current {
  font-size: 0.95rem;
  font-weight: bold;
  background: var(--panel);
  border: 1px solid var(--cell-border);
  border-radius: 8px;
  padding: 8px 12px;
  flex: 1 1 200px;
  min-height: 1.2em;
}

.board-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.board-actions button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--cell-border);
  background: var(--panel);
  cursor: pointer;
}

.board-actions button:hover { background: #efe9d8; }

.grid-container {
  width: 100%;
  overflow: auto;
  border: 3px solid var(--ink);
  background: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  aspect-ratio: 1 / 1;
  width: min(100%, 620px);
  margin: 0 auto;
}

.cell {
  position: relative;
  background: #fff;
  border-right: 1px solid var(--cell-border);
  border-bottom: 1px solid var(--cell-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell.box-right { border-right: 2px solid var(--ink); }
.cell.box-bottom { border-bottom: 2px solid var(--ink); }

.cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(16px, 4.2vw, 30px);
  padding: 0;
  outline: none;
  color: var(--ink);
}

.cell.given input {
  color: var(--ink);
  font-weight: 900;
  background: #efece2;
}
.cell.given input { caret-color: transparent; }

.cell.peer input { background: var(--focus-word); }
.cell.same-value input { background: #f3ddb0; }
.cell.focus-cell input { background: var(--focus-cell); }
.cell.correct input { background: var(--correct); }
.cell.incorrect input { background: var(--incorrect); }

.level-tabs {
  padding-bottom: 4px;
}
.level-tabs button {
  font-weight: bold;
  font-size: 0.9rem;
}

.status {
  min-height: 1.4em;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  #app { padding: 12px; }
}
