/* B Square — game-specific styles on top of the Buttonberry design system. */

:root { --accent: #0d9488; --warm: #d97706; }

/* ---------- spiral board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(var(--grid-size, 5), 1fr);
  gap: max(3px, calc(10px - var(--grid-size, 5) * 0.7px));
  max-width: min(420px, 100%);
  margin: 4px auto 0;
}
:root[data-board="large"] .board { max-width: 100%; }

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(11px, calc(15vw / var(--grid-size, 5)), 26px);
  text-transform: uppercase;
  border-radius: max(4px, calc(12px - var(--grid-size, 5))) ;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.cell.revealed { background: var(--accent); border-color: var(--accent); color: #fff; }
.cell.start { background: var(--warm); border-color: var(--warm); color: #fff; }
.cell.prefilled {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}
.cell.centre-mark { border-style: dashed; color: var(--muted); font-size: 13px; }
.cell.win { animation: cell-pop .35s ease; }

@keyframes cell-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cell.win { animation: none; }
}

/* ---------- clue + answer ---------- */

.clue { font-family: var(--serif); font-size: 21px; line-height: 1.35; margin: 6px 0 2px; }

.answer-row { display: flex; gap: 10px; margin-top: 14px; }
.answer-row .input { flex: 1; min-width: 0; text-transform: uppercase; }

#feedback { min-height: 18px; margin-top: 10px; font-weight: 600; }
#feedback.warning { color: var(--bad); }
#feedback.success { color: var(--good); }

.progress-track { height: 6px; border-radius: 999px; background: var(--border); margin-top: 16px; overflow: hidden; }
.progress-track .fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }

/* ---------- completion card ---------- */

.done-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  text-align: center;
}

/* ---------- achievements in stats dialog ---------- */

.ach-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ach-row { display: flex; align-items: center; gap: 11px; font-size: 13.5px; }
.ach-row .ach-icon {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  background: var(--subtle); border: 1.5px solid var(--warm);
}
.ach-row.locked .ach-icon { border-color: var(--border); filter: grayscale(1); opacity: .5; }
.ach-row.locked { color: var(--muted); }
.ach-row .ach-name { font-weight: 600; }
.ach-row .ach-desc { color: var(--muted); font-size: 12.5px; }

@media (min-width: 720px) {
  .board { max-width: 520px; }
}
