/* Emotibears word search — self-contained styles, matching jigsaw.css. */
.eb-wordsearch {
  /* Canonical tokens from styles.css (CLAUDE.md §11), with fallbacks. */
  --eb-charcoal: var(--ink, #3A342E);
  --eb-heading: var(--navy, #3A342E);
  --eb-btn: var(--coral-btn, #CE491A);           /* AA with white text */
  --eb-btn-shadow: var(--coral-btn-shadow, #A93C15);
  --eb-sky: #4FB6E0;
  --eb-sunshine: #FFC845;
  --eb-board: var(--cream-2, #F3E7D6);
  --eb-line: #E2D2BC;
  font-family: "Nunito Sans", system-ui, sans-serif;
  color: var(--eb-charcoal);
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 0 32px;
}
.eb-wordsearch *, .eb-wordsearch *::before, .eb-wordsearch *::after { box-sizing: border-box; }

.eb-ws__title {
  font-family: "Baloo 2", "Nunito Sans", system-ui, sans-serif;
  font-weight: 700; color: var(--eb-heading);
  font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 4px; text-align: center;
}
.eb-ws__intro { text-align: center; margin: 0 0 16px; font-size: 1.05rem; }

.eb-ws__controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; margin-bottom: 6px; }
.eb-ws__group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.eb-ws__label { font-weight: 700; margin-right: 2px; }
.eb-wordsearch button:not(.eb-ws__cell) {
  font: inherit; font-weight: 700;
  min-height: 44px; min-width: 44px; padding: 8px 18px;
  border-radius: 999px; border: 2px solid var(--eb-charcoal);
  background: #fff; color: var(--eb-charcoal); cursor: pointer;
}
.eb-wordsearch button:not(.eb-ws__cell):hover { background: var(--eb-board); }
.eb-wordsearch button:focus-visible { outline: 3px solid var(--eb-sky); outline-offset: 3px; }
/* Coral is CTA-only per the brand guide: New puzzle is the primary action */
.eb-wordsearch button.eb-ws__primary { background: var(--eb-btn); border-color: var(--eb-btn); color: #fff; box-shadow: 0 4px 0 var(--eb-btn-shadow); }
.eb-wordsearch button.eb-ws__primary:hover { background: var(--eb-btn); transform: translateY(-1px); }
.eb-wordsearch button.eb-ws__level[aria-pressed="true"] { background: var(--eb-sunshine); }
.eb-ws__levelhelp { text-align: center; margin: 0 0 8px; font-size: .9rem; color: #665c4c; }
.eb-ws__status { text-align: center; font-weight: 700; margin: 0 0 10px; min-height: 1.5em; }

.eb-ws__play { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 24px; align-items: start; }
@media (max-width: 760px) { .eb-ws__play { grid-template-columns: 1fr; } }

.eb-ws__grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 10), 1fr);
  width: 100%; max-width: calc(var(--n, 10) * 46px); margin: 0 auto;
  background: #fff; border: 2px solid var(--eb-line); border-radius: 14px; padding: 6px;
  touch-action: none;          /* dragging across letters must not scroll the page */
  user-select: none; -webkit-user-select: none;
}
.eb-ws__cell {
  aspect-ratio: 1; min-width: 0; padding: 0; margin: 0;
  border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-family: "Baloo 2", "Nunito Sans", system-ui, sans-serif; font-weight: 700;
  font-size: inherit; line-height: 1; color: var(--eb-heading); cursor: pointer;
}
.eb-ws__cell:hover { background: var(--eb-board); }
.eb-ws__cell:focus-visible { outline: 3px solid var(--eb-sky); outline-offset: -3px; position: relative; z-index: 1; }
.eb-ws__cell.is-found { background: var(--found, var(--eb-sunshine)); }
.eb-ws__cell.is-answer { box-shadow: inset 0 0 0 3px var(--eb-btn); }
.eb-ws__cell.is-sel { background: #CDEBF7; }
.eb-ws__cell.is-start { background: var(--eb-sky); color: #fff; }

.eb-ws__side { background: var(--eb-board); border-radius: 14px; padding: 14px 16px; }
.eb-ws__listtitle { font-family: "Baloo 2", "Nunito Sans", sans-serif; color: var(--eb-heading); font-size: 1.2rem; margin: 0; }
.eb-ws__count { margin: 2px 0 10px; font-weight: 700; font-size: .9rem; }
.eb-ws__list { list-style: none; margin: 0; padding: 0; column-gap: 12px; }   /* one column beside the grid */
@media (max-width: 760px) { .eb-ws__list { columns: 3; } }
@media (max-width: 420px) { .eb-ws__list { columns: 2; } }
.eb-ws__list li { padding: 3px 0; font-weight: 700; break-inside: avoid; white-space: nowrap; }
.eb-ws__list li.is-found { text-decoration: line-through; color: #6b604e; }
.eb-ws__list li.is-found::before { content: "✓ "; color: #2F6B61; }
.eb-ws__list li.is-answer { color: var(--eb-btn-shadow); }

.eb-ws__help { font-size: .85rem; color: #665c4c; margin: 14px 0 0; text-align: center; }

.eb-ws__win {
  margin: 18px auto 0; max-width: 420px; text-align: center;
  background: #fff; border: 3px solid var(--eb-sunshine); border-radius: 18px; padding: 18px;
}
.eb-ws__win[hidden] { display: none; }
.eb-ws__win h3 { color: var(--eb-heading); font-family: "Baloo 2", "Nunito Sans", sans-serif; font-size: 1.8rem; margin: 0 0 6px; }
.eb-ws__win p { margin: 0 0 12px; }

@media (prefers-reduced-motion: reduce) { .eb-wordsearch button.eb-ws__primary:hover { transform: none; } }
