.bar #title { font-weight: 600; }

.clue {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 14px; min-height: 5.2em;
}
.clue p { margin: 0; }
.clue-head { display: flex; gap: 10px; align-items: baseline; font-size: var(--fs-sm); }
.clue-dir { color: var(--accent); font-weight: 700; }
.clue-text { font-size: var(--fs-body); }
.clue-en { color: var(--muted); font-style: italic; font-size: var(--fs-sm); }

/* The board fills the width up to 52px a cell; letters scale with the cell. */
.board-wrap { display: flex; justify-content: center; margin: 14px 0 6px; }
.board {
  --cols: 7; --rows: 7;
  width: min(100%, calc(var(--cols) * 52px));
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px;
  container-type: inline-size;
}
.board .void { aspect-ratio: 1; }
.cell {
  aspect-ratio: 1; padding: 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; box-shadow: var(--shadow); position: relative;
}
.cell .py { font-size: calc(100cqw / var(--cols) * 0.2); color: var(--muted); min-height: 1.1em; line-height: 1.1; }
.cell .hz { font-family: var(--kai); font-size: calc(100cqw / var(--cols) * 0.56); line-height: 1.05; }
.cell.empty { background-color: var(--surface); border: 1.5px dashed var(--muted); box-shadow: none; }
.cell.mine .hz { color: var(--accent); }
.cell.revealed .hz { color: var(--muted); }
.cell.active { background-color: var(--mark); }
.cell.empty.active { background-color: var(--mark); }
.cell.selected { outline: 3px solid var(--select); outline-offset: 0; z-index: 1; }
.cell.solved { background: var(--good-bg); border-color: var(--good); }
.cell.solved .hz { color: var(--good); }
.cell.solved.active { background: var(--good-bg); }

.cell.shake { animation: shake 0.4s; border-color: var(--bad); }
@keyframes shake {
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) { .cell.shake { animation: none; } }

.msg { min-height: 1.6em; margin: 4px 0 8px; font-weight: 600; text-align: center; }
.msg.good { color: var(--good); }
.msg.bad { color: var(--bad); }

.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.tile { font-family: var(--kai); font-size: 1.9rem; padding: 4px 0; line-height: 1.3; box-shadow: var(--shadow); }
.tile:disabled { visibility: hidden; }

.tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; }

#done h1 { text-align: center; font-size: var(--kai-title); letter-spacing: 0.02em; margin-top: 0.6em; }
.stars { display: flex; justify-content: center; margin: 10px 0 4px; }
.done-note { text-align: center; margin: 0 0 8px; }
.board.mini { width: min(80%, calc(var(--cols) * 32px)); gap: 2px; }
.board.mini .cell { box-shadow: none; border-radius: 6px; }
.board.mini .cell .hz { font-size: calc(100cqw / var(--cols) * 0.62); }
.sum-list .en { font-style: italic; }
.sum-list .story { margin: 6px 0 0; }
.sum-list .story summary { font-size: var(--fs-sm); }
.sum-list .story p { margin: 6px 0 0; font-size: var(--fs-sm); }
.sum-list .speak { float: right; min-width: 44px; min-height: 44px; margin: -8px -8px 0 0; padding: 0; border: none; background: transparent; }
.sum-list .ex mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }

/* Finish: how each idiom went, for mastery. */
.groups {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 14px; margin: 4px 0 14px; display: grid; gap: 6px;
}
.group { display: flex; gap: 12px; align-items: baseline; }
.group-label { flex: 0 0 4.6em; font-size: var(--fs-sm); font-weight: 600; }
.group.good .group-label, .group.good .w { color: var(--good); }
.group.bad .group-label { color: var(--bad); }
.group-words { display: flex; flex-wrap: wrap; gap: 0 12px; line-height: 1.5; }
.group-words .w { font-family: var(--kai); font-size: var(--kai-word); }
.group-words .why { font-size: var(--fs-xs); margin-left: 4px; }
.group-note { flex-basis: 100%; margin: 0; font-size: var(--fs-xs); }
.list-head { font-size: var(--fs-sm); color: var(--muted); margin: 14px 0 6px; }
