/* Word Hunt */
.hunt-shell {
  width: min(100% - 2rem, 820px);
  margin: 0 auto;
}

.hunt-shell .lede {
  margin-bottom: 1.1rem;
}

.hunt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.hunt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.hunt-meta .theme {
  color: var(--accent-deep);
}

.hunt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.hunt-panel {
  border: none;
  box-shadow:
    0 2px 6px rgba(20, 33, 43, 0.06),
    0 14px 32px rgba(20, 33, 43, 0.12);
}

.play-board {
  padding: 0.95rem 0.95rem 0.85rem;
}

/* Fixed slot so the pick pill never shifts the grid */
.hunt-pick-slot {
  height: 2.15rem;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
}

.hunt-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 1.9rem;
  margin: 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: #f0a202;
  color: #14352e;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.hunt-pick.is-visible {
  opacity: 1;
  visibility: visible;
}

.hunt-pick.is-found {
  background: #1f9d6a;
  color: #fff;
}

.hunt-board {
  position: relative;
}

.hunt-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.hunt-lines .link {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hunt-grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.35rem;
  user-select: none;
  touch-action: none;
}

.hunt-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: #eef6f2;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.8vw, 1.1rem);
  cursor: pointer;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  position: relative;
  z-index: 2;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.hunt-cell:focus-visible {
  outline: 3px solid rgba(15, 122, 106, 0.35);
  outline-offset: 1px;
}

.hunt-cell.is-active {
  background: #f0a202;
  color: #14352e !important;
  box-shadow: 0 0 0 2px rgba(240, 162, 2, 0.35);
}

.hunt-cell.is-found {
  background: #1f9d6a;
  color: #fff !important;
}

.hunt-cell.is-found.is-active {
  background: #f0a202;
  color: #14352e !important;
}

.hunt-feedback {
  height: 1.35rem;
  margin: 0.7rem 0 0;
  font-weight: 700;
  color: var(--accent-deep);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hunt-words {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  padding: 1rem 1rem 0.9rem;
}

.hunt-words-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e6ece9;
}

.hunt-words-head h2 {
  font-family: var(--font-body, inherit);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  color: #3d6b8a;
  white-space: nowrap;
}

.word-count {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
  background: #eef1f4;
  border-radius: 7px;
  padding: 0.2rem 0.5rem;
  line-height: 1.2;
}

.hunt-words #words {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.45rem;
  width: 100%;
}

.hunt-words #words li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #eef1f4;
  border: none;
  font-size: inherit;
}

.hunt-words #words li.is-found {
  justify-content: flex-start;
  color: #fff;
  background: #6fa88a;
}

.hunt-words #words li.is-found::before {
  content: "✓";
  font-size: 0.85em;
  line-height: 1;
  margin-left: 0.15rem;
}

.hunt-words-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e6ece9;
}

.hunt-words-actions .btn {
  width: 100%;
}

.how-to {
  margin-top: 1rem;
}

.how-to h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}

.how-to p,
.how-to li {
  color: var(--ink-soft);
  margin: 0 0 0.45rem;
}

.how-to ul {
  margin: 0;
  padding-left: 1.15rem;
}

.play-board.is-celebrate {
  animation: hunt-glow 750ms ease;
}

@keyframes hunt-glow {
  0% {
    box-shadow:
      0 2px 6px rgba(20, 33, 43, 0.06),
      0 14px 32px rgba(20, 33, 43, 0.12);
  }
  45% {
    box-shadow:
      0 0 0 4px rgba(240, 162, 2, 0.35),
      0 14px 34px rgba(15, 122, 106, 0.2);
  }
  100% {
    box-shadow:
      0 2px 6px rgba(20, 33, 43, 0.06),
      0 14px 32px rgba(20, 33, 43, 0.12);
  }
}

@media (max-width: 720px) {
  .hunt-layout {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hunt-cell,
  .hunt-pick {
    transition: none;
  }
}
