/* WordSeek styles: phone-first, touch targets >= 44px, light + dark themes. */
:root { --banner-h: 0px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f0fdfa;
  color: #134e4a;
  padding-bottom: var(--banner-h);
}
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #0f766e; color: #fff; padding: 12px 16px;
  position: sticky; top: 0; z-index: 10;
}
.appbar h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
.appbar-right { display: flex; gap: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
main { max-width: 520px; margin: 0 auto; padding: 16px 12px 24px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
.tagline { font-size: 16px; line-height: 1.5; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 2px solid #99f6e4; background: #fff; color: #0f766e;
  font-size: 15px; cursor: pointer;
}
.chip.active { background: #0f766e; color: #fff; border-color: #0f766e; }
.best-line { margin: 16px 0; font-size: 15px; }
.primary, .secondary, .small {
  min-height: 48px; border-radius: 12px; border: none; cursor: pointer; font-size: 16px;
}
.primary { background: #0f766e; color: #fff; padding: 0 24px; font-weight: 700; }
.secondary { background: #ccfbf1; color: #0f766e; padding: 0 20px; margin-left: 8px; }
.small { min-height: 44px; background: #ccfbf1; color: #0f766e; padding: 0 12px; font-size: 14px; }
.howto { font-size: 14px; line-height: 1.5; color: #115e59; }
.game-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.game-meta span { font-weight: 700; text-transform: capitalize; }
.game-actions { display: flex; gap: 6px; }
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), 1fr);
  gap: 3px;
  width: min(92vw, 420px);
  margin: 0 auto;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.cell {
  aspect-ratio: 1;
  border: none; border-radius: 8px;
  background: #fff; color: #134e4a;
  font-size: clamp(15px, 6.5vw, 22px); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cell.sel { background: #5eead4; color: #042f2e; }
.cell.found { background: #0f766e; color: #fff; }
.cell.hint { outline: 3px solid #f59e0b; outline-offset: -3px; }
.word-list {
  list-style: none; padding: 0; margin: 16px 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.word-list li {
  background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.5px;
}
.word-list li.done { background: #ccfbf1; color: #115e59; text-decoration: line-through; opacity: 0.75; }
.status { min-height: 22px; font-size: 15px; text-align: center; }
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px;
}
.overlay[hidden] { display: none; }
.overlay-card { background: #fff; border-radius: 16px; padding: 24px; max-width: 380px; text-align: center; }
.overlay-card h2 { margin-top: 0; }
@media (prefers-color-scheme: dark) {
  body { background: #042f2e; color: #ccfbf1; }
  .chip { background: #134e4a; color: #ccfbf1; border-color: #0f766e; }
  .chip.active { background: #14b8a6; color: #042f2e; }
  .secondary, .small { background: #134e4a; color: #ccfbf1; }
  .cell { background: #134e4a; color: #f0fdfa; }
  .cell.sel { background: #14b8a6; color: #042f2e; }
  .cell.found { background: #14b8a6; color: #042f2e; }
  .word-list li { background: #134e4a; }
  .word-list li.done { background: #115e59; color: #99f6e4; }
  .overlay-card { background: #134e4a; color: #ccfbf1; }
  .howto { color: #99f6e4; }
}
