/* ============================================================
   Find Your Feelings (word search) — /games/word-search
   Scoped under .gws. Built on the main site token set.
   ============================================================ */

/* the hidden attribute always wins over display classes */
.gws [hidden] { display: none !important; }

.gws {
  background: var(--paper);
  padding: clamp(96px, 13vw, 150px) 20px clamp(72px, 9vw, 120px);
}
.gws-inner { max-width: 980px; margin: 0 auto; }

/* ---- header -------------------------------------------------------------- */
.gws-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 0 0 12px;
}
.gws-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.04;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}
.gws-title em {
  font-style: italic;
  background: var(--gradient-spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gws-lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 0 14px;
}
.gws-howto { color: var(--ink-soft); font-size: 15px; max-width: 560px; margin: 0 0 10px; }
.gws-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 34px;
}

/* ---- variant switcher ---------------------------------------------------- */
.gws-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.gws-vbtn {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.gws-vbtn:hover { border-color: var(--ink-faint); }
.gws-vbtn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}
.gws-vbtn-num {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.7;
  margin-right: 4px;
}

/* ---- layout -------------------------------------------------------------- */
.gws-layout {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(200px, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}
@media (max-width: 760px) {
  .gws-layout { grid-template-columns: 1fr; }
}

/* ---- grid ---------------------------------------------------------------- */
.gws-grid {
  display: grid;
  grid-template-columns: repeat(var(--gws-cols), minmax(0, 1fr));
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.gws-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(13px, 2.6vw, 21px);
  color: var(--ink);
  cursor: pointer;
  position: relative;
}

/* live drag preview */
.gws-cell.is-drag { background: var(--accent-gold-soft); }

/* found words: seven soft accent fills, cycled per word index */
.gws-cell.is-found { color: var(--ink); }
.gws-cell[data-found-hue="0"] { background: var(--accent-purple-soft); }
.gws-cell[data-found-hue="1"] { background: var(--accent-blue-soft); }
.gws-cell[data-found-hue="2"] { background: var(--accent-green-soft); }
.gws-cell[data-found-hue="3"] { background: var(--accent-gold-soft); }
.gws-cell[data-found-hue="4"] { background: var(--accent-coral-soft); }
.gws-cell[data-found-hue="5"] { background: var(--accent-magenta-soft); }
.gws-cell[data-found-hue="6"] { background: var(--accent-rose-soft); }

/* the secret: once all words are found, unclaimed letters light up */
.gws-grid.is-secret .gws-cell[data-secret] {
  animation: gws-glow 0.9s ease forwards;
  animation-delay: calc(var(--gws-delay, 0) * 60ms);
  color: var(--brand-ink);
  font-weight: 500;
}
.gws-grid.is-secret .gws-cell:not([data-secret]):not(.is-found) { color: var(--ink-ghost); }
@keyframes gws-glow {
  0% { background: var(--white); }
  60% { background: var(--accent-magenta-soft); transform: scale(1.12); }
  100% { background: var(--accent-magenta-soft); transform: scale(1); }
}

.gws-restart { margin-top: 14px; }

/* ---- word list ----------------------------------------------------------- */
.gws-side h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 6px;
}
.gws-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.gws-words {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (min-width: 761px) {
  .gws-words { display: block; }
  .gws-words li { margin-bottom: 8px; }
}
.gws-words li {
  display: inline-block;
  font-size: 15px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  background: var(--white);
}
.gws-words li.is-found {
  text-decoration: line-through;
  color: var(--ink-ghost);
  border-color: transparent;
  background: var(--paper-2);
}

/* ---- buttons ------------------------------------------------------------- */
.gws-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  min-height: 44px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.gws-btn-primary { background: var(--brand); color: var(--white); border-color: var(--brand); }
.gws-btn-primary:hover { transform: translateY(-2px); color: var(--white); }
.gws-btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.gws-btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }

/* ---- reveal -------------------------------------------------------------- */
.gws-reveal {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(42, 34, 51, 0.08);
  padding: 34px 30px;
  max-width: 640px;
}
.gws-reveal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  color: var(--ink);
  margin: 0 0 12px;
}
.gws-secret {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 2.8vw, 30px);
  color: var(--brand-ink);
  margin: 0 0 14px;
}
.gws-reveal-body { color: var(--ink-soft); margin: 0 0 20px; }
.gws-reveal-row { display: flex; flex-wrap: wrap; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .gws-grid.is-secret .gws-cell[data-secret] { animation: none; background: var(--accent-magenta-soft); }
  .gws-btn, .gws-btn:hover { transition: none; transform: none; }
}
