.wfs-section { background: var(--bg); padding-top: 84px; padding-bottom: 56px; min-height: 70vh; }

.wfs-back      { margin-bottom: 8px; }
.wfs-back-link { font-size: 14px; font-weight: 700; color: var(--teal); text-decoration: none; }
.wfs-back-link:hover { text-decoration: underline; }

.wfs-header { text-align: center; margin-bottom: 16px; }
.wfs-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--navy);
}

.wfs-status { text-align: center; font-size: 16px; font-weight: 600; color: var(--muted); padding: 40px 0; }

/* ── Other word lengths ── */
.wfs-length-nav { max-width: 460px; margin: 0 auto 20px; }
.wfs-length-nav-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.wfs-length-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.wfs-length-pill { display: inline-block; background: #fff; border: 1.5px solid #cfe8ec; color: var(--navy); font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 20px; text-decoration: none; }
a.wfs-length-pill:hover { border-color: #16a34a; color: #16a34a; }
.wfs-length-pill--active { background: #16a34a; border-color: #16a34a; color: #fff; }

/* ── Progress ── */
.wfs-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto 24px;
}
.wfs-progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
}
.wfs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #0d9488);
  border-radius: 50px;
  transition: width 0.35s ease;
}
.wfs-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Board layout ── */
.wfs-board {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.wfs-grid-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,80,140,0.1);
  background: #fff;
  padding: 10px;
}

.wfs-grid {
  display: grid;
  grid-template-columns: repeat(13, 42px);
  grid-template-rows: repeat(13, 42px);
  gap: 1px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.wfs-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
  background: #f8fafc;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.wfs-cell--selecting { background: #bae6fd; color: #075985; }
.wfs-cell--found      { background: #86efac; color: #14532d; }
.wfs-cell--wrong       { background: #fecaca; color: #991b1b; }

/* ── Sidebar / word list ── */
.wfs-sidebar {
  width: 220px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 6px 24px rgba(0,80,140,0.1);
}
.wfs-sidebar-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 14px;
}
.wfs-wordlist { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.wfs-wordlist-item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--navy); }
.wfs-wordlist-word { transition: opacity 0.18s; }
.wfs-wordlist-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  color: transparent;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.wfs-wordlist-item--found { color: #16a34a; }
.wfs-wordlist-item--found .wfs-wordlist-word { text-decoration: line-through; opacity: 0.7; }
.wfs-wordlist-item--found .wfs-wordlist-check { background: #16a34a; border-color: #16a34a; color: #fff; }

.wfs-done { margin-top: 18px; text-align: center; }
.wfs-done-icon { font-size: 36px; line-height: 1; }
.wfs-done-text { font-size: 14px; font-weight: 700; color: var(--navy); margin: 6px 0 12px; }
.wfs-newgame-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  padding: 11px 24px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #16a34a, #0d9488);
  color: #fff;
  box-shadow: 0 4px 16px rgba(22,163,74,0.32);
  transition: transform 0.18s, box-shadow 0.18s;
}
.wfs-newgame-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22,163,74,0.44); }

/* Grid column/row count here must match SIZE in word-finder-session.js for this
   breakpoint (8 on mobile) -- the JS only creates as many .wfs-cell elements as
   SIZE*SIZE, so a mismatched column count here would misshape the layout. */
@media (max-width: 640px) {
  .wfs-grid { grid-template-columns: repeat(8, 44px); grid-template-rows: repeat(8, 44px); }
  .wfs-cell { font-size: 20px; }
  .wfs-sidebar { width: 100%; }
  .wfs-length-pill[data-n="8"], .wfs-length-pill[data-n="9"], .wfs-length-pill[data-n="10"] { display: none; }
}

.wfs-status a { color: var(--teal); font-weight: 700; text-decoration: none; }
.wfs-status a:hover { text-decoration: underline; }

/* ── How to play ── */
.wfs-howto {
  background: #f0f4f8;
  padding: 48px 5vw 56px;
  margin-top: 8px;
}
.wfs-howto-inner {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 32px 36px;
  box-shadow: 0 4px 16px rgba(0,80,140,0.07);
  border-left: 5px solid #16a34a;
}
.wfs-howto-heading {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 18px;
  color: #0d2545;
  margin-bottom: 14px;
}
.wfs-howto-text {
  font-size: 14px;
  color: #5f7897;
  font-weight: 600;
  line-height: 1.85;
}
