/* Word Search Maker — turn your own word list into a printable word search */

.wsm-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wsm-label {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  font-weight: 700;
  margin-top: 8px;
}

.wsm-input, .wsm-textarea {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.wsm-input:focus, .wsm-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.wsm-hint {
  font-size: 0.8rem;
  color: var(--color-text-soft);
}

.wsm-error {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.wsm-setup h3, .wsm-form h3 {
  margin: 10px 0 0;
  font-size: 1.05rem;
}

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

.wsm-pick {
  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;
  font-weight: 700;
}

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

.wsm-generate-btn {
  align-self: flex-start;
  margin-top: 8px;
}

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

.wsm-puzzle-title {
  text-align: center;
  margin: 0;
  font-size: 1.2rem;
}

.wsm-banner {
  text-align: center;
  font-weight: 700;
  color: var(--color-text);
}

.wsm-banner-done {
  color: var(--color-success);
}

.wsm-dropped {
  text-align: center;
  color: var(--color-accent);
  font-size: 0.85rem;
}

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

.wsm-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%;
}

.wsm-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;
}

.wsm-cell:hover { background: var(--color-surface-hover); }
.wsm-cell--sel { background: rgba(79, 216, 224, 0.35); }
.wsm-cell--cursor { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.wsm-cell--found { background: rgba(74, 222, 128, 0.3); color: var(--color-success); }

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

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

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

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

@media print {
  .site-header, .site-footer, #site-header, #site-footer,
  .breadcrumb, .game-shell__header, .stats-row, .side-stack,
  .seo-content, .recommend-section, .wsm-actions, .wsm-banner,
  .wsm-dropped, .wsm-word--found {
    display: none !important;
  }
  .wsm-play { background: none !important; border: none !important; }
  .wsm-cell--found, .wsm-cell--sel, .wsm-cell--cursor {
    background: none !important;
    outline: none !important;
    color: #000 !important;
  }
  .wsm-grid, .wsm-cell, .wsm-word, .wsm-puzzle-title {
    color: #000 !important;
    background: #fff !important;
    border-color: #000 !important;
  }
}
