/* Word Search — find every hidden word in the grid, 8 themes, 6 tiers */

.ws-setup {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ws-setup h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.ws-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ws-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  min-width: 170px;
  text-align: left;
}

.ws-pick strong { font-size: 1rem; }
.ws-pick small { color: var(--color-text-soft); }

.ws-pick[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: rgba(79, 216, 224, 0.12);
}

.ws-pick:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ws-start-btn {
  align-self: flex-start;
  margin-top: 4px;
}

.ws-rewards {
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

.ws-rewards strong { color: var(--color-text); }

.ws-play {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(102, 187, 106, 0.12), rgba(27, 94, 32, 0.1));
  border: 1px solid var(--color-border);
}

.ws-theme-desert { background: linear-gradient(180deg, rgba(255, 183, 77, 0.14), rgba(191, 87, 0, 0.12)); }
.ws-theme-arctic { background: linear-gradient(180deg, rgba(79, 216, 224, 0.14), rgba(1, 87, 155, 0.12)); }
.ws-theme-reef { background: linear-gradient(180deg, rgba(236, 64, 122, 0.12), rgba(1, 87, 155, 0.14)); }
.ws-theme-golden { background: linear-gradient(180deg, rgba(255, 213, 79, 0.18), rgba(191, 87, 0, 0.14)); }

.ws-banner {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ws-timer {
  color: var(--color-accent);
  white-space: nowrap;
}

.ws-banner--good {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  font-size: 1.05rem;
  display: block;
}

.ws-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
}

.ws-grid {
  display: grid;
  gap: 2px;
  background: var(--color-border);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  padding: 2px;
  max-width: 480px;
  width: 100%;
}

.ws-cell {
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  color: var(--color-text);
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.6rem, 2vw, 1rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ws-cell:hover { background: var(--color-surface-hover); }

.ws-cell--sel {
  background: rgba(79, 216, 224, 0.35);
}

.ws-cell--cursor {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.ws-cell--found {
  background: rgba(74, 222, 128, 0.3);
  color: var(--color-success);
}

.ws-words {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
}

.ws-word {
  font-weight: 700;
  color: var(--color-text);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--color-bg-alt);
}

.ws-word--found {
  color: var(--color-text-soft);
  text-decoration: line-through;
  background: transparent;
}

.ws-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Printable output: hide everything except the puzzle grid and word list,
   so the "print" button genuinely produces a clean printable word search
   rather than a screenshot of the whole page chrome. */
@media print {
  .site-header, .site-footer, #site-header, #site-footer,
  .breadcrumb, .game-shell__header, .stats-row, .side-stack,
  .seo-content, .recommend-section, .ws-setup, .ws-banner,
  .ws-actions, .ws-word--found {
    display: none !important;
  }
  .ws-play {
    background: none !important;
    border: none !important;
  }
  .ws-cell--found, .ws-cell--sel, .ws-cell--cursor {
    background: none !important;
    outline: none !important;
    color: #000 !important;
  }
  .ws-grid, .ws-cell, .ws-word {
    color: #000 !important;
    background: #fff !important;
    border-color: #000 !important;
  }
}
