/* Word Search — ink on parchment, the paper-puzzle family. */

[hidden] { display: none !important; }

.ws-frame {
  width: min(860px, 97vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(10px, 2.2vw, 18px);
}
.deal-line {
  margin: 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(14px, 2.1vw, 16.5px);
  color: var(--ink-soft);
  min-height: 1.4em;
}
.deal-line b { color: var(--oxblood); font-weight: 600; }

.ws-lay {
  display: flex;
  gap: clamp(10px, 2vw, 18px);
  align-items: flex-start;
}

/* ---- the field ---- */
.field-wrap { flex: 1 1 auto; min-width: 0; }
.field {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  aspect-ratio: 1;
  background: linear-gradient(180deg, var(--cream), #efe3c2);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px rgba(122, 104, 80, .5), 0 3px 10px rgba(0, 0, 0, .25);
  padding: clamp(4px, .9vw, 8px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.cell {
  position: relative;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--display);
  font-size: clamp(13px, 2.6vw, 24px);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}
.cell::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 6px;
  z-index: 0;
}
.cell span { position: relative; z-index: 1; }
.cell.path::before { background: rgba(227, 183, 84, .38); box-shadow: inset 0 0 0 1.5px rgba(200, 156, 58, .8); }
.cell.anchor::before { background: rgba(227, 183, 84, .5); box-shadow: inset 0 0 0 2px rgba(200, 156, 58, .95); }
.cell.found::before { background: hsla(var(--hue), 46%, 42%, .26); box-shadow: inset 0 0 0 1.5px hsla(var(--hue), 50%, 34%, .55); }
.cell.hint-pulse::before { animation: hintpulse 1s ease 2; }
@keyframes hintpulse {
  0%, 100% { background: none; box-shadow: none; }
  50% { background: rgba(122, 176, 132, .5); box-shadow: inset 0 0 0 2px rgba(76, 128, 88, .9); }
}

/* ---- the quarry list ---- */
.quarry {
  flex: 0 0 clamp(150px, 22vw, 210px);
  list-style: none;
  margin: 0;
  padding: clamp(8px, 1.4vw, 14px);
  border-radius: 10px;
  background: rgba(246, 238, 214, .55);
  box-shadow: inset 0 0 0 1px rgba(122, 104, 80, .35);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.quarry li {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: clamp(11.5px, 1.6vw, 13.5px);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.quarry li::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1.5px rgba(122, 104, 80, .6);
}
.quarry li.found { color: rgba(58, 48, 36, .5); text-decoration: line-through; text-decoration-color: hsla(var(--hue), 50%, 36%, .8); }
.quarry li.found::before { background: hsla(var(--hue), 46%, 42%, .8); box-shadow: none; }

.frame-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }

.new-best {
  display: inline-block;
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  color: var(--parchment);
  background: var(--oxblood);
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

@media (max-width: 640px) {
  .ws-lay { flex-direction: column; }
  .quarry {
    flex: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 14px;
    justify-content: center;
  }
}
