/* ------------------------------------------------------------------
   Word deck · shared engine
   Random word generator with optional timed, scored rounds.
   Used by the Charades Generator and Pictionary Word Generator.
------------------------------------------------------------------ */

.word-deck-page {
  --wd-bg: #111315;
  --wd-text: #f1f7ee;
  --wd-accent: #ff2959;
  --wd-accent-hover: #e32751;
  --wd-card-bg: #f1f7ee;
  --wd-card-text: #1b2a31;
  --wd-line: rgba(241, 247, 238, 0.14);
  --wd-chip: rgba(241, 247, 238, 0.08);
}

.wd-stage {
  width: 100%;
  min-height: calc(100vh - 64px);
  padding: 28px 16px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wd-bg);
  color: var(--wd-text);
}
.wd-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.wd-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wd-cats button,
.wd-seg button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--wd-line);
  background: var(--wd-chip);
  color: var(--wd-text);
  font: 500 14px 'Inter', sans-serif;
  cursor: pointer;
}
.wd-cats button[aria-pressed="true"],
.wd-seg button[aria-pressed="true"] {
  background: var(--wd-accent);
  border-color: var(--wd-accent);
  color: #fff;
}

.wd-status {
  display: flex;
  gap: 16px;
  min-height: 34px;
  align-items: center;
  font-family: 'Crete Round', serif;
  font-size: 26px;
}
.wd-timer.is-low { color: var(--wd-accent); }
.wd-score { opacity: 0.8; font-size: 20px; }

.wd-card {
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
  padding: 36px 28px;
  background: var(--wd-card-bg);
  color: var(--wd-card-text);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.wd-card.leaving { transform: translateY(-16px) scale(0.98); opacity: 0; }
.wd-card.entering { transform: translateY(16px) scale(0.98); opacity: 0; }

.wd-cat {
  font: 700 12px 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--wd-accent);
  color: #fff;
  margin-bottom: 18px;
}
.wd-cat:empty { display: none; }
.wd-word {
  margin: 0;
  font-family: 'Crete Round', serif;
  font-size: clamp(28px, 7vw, 48px);
  line-height: 1.2;
  color: var(--wd-card-text);
  overflow-wrap: anywhere;
}
.wd-word.is-small { font-size: clamp(20px, 4vw, 26px); opacity: 0.8; }

.wd-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wd-actions[hidden] { display: none; }
.wd-btn {
  background: var(--wd-accent);
  color: #fff;
  font-family: 'Crete Round', serif;
  font-size: 22px;
  padding: 16px 40px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(255, 41, 89, 0.6);
  transition: background 0.2s ease, transform 0.1s ease;
}
.wd-btn:hover { background: var(--wd-accent-hover); }
.wd-btn:active { transform: translateY(1px); }
.wd-btn:disabled { opacity: 0.4; cursor: default; }
.wd-btn-ghost { background: transparent; border: 1px solid var(--wd-line); box-shadow: none; }
.wd-btn-ghost:hover { background: var(--wd-chip); }

.wd-timer-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 14px;
  opacity: 0.9;
}
.wd-seg { display: flex; gap: 6px; }

/* Rules section */
.wd-rules {
  background: var(--wd-bg);
  color: var(--wd-text);
  padding: 48px 0 32px;
  border-top: 1px solid var(--wd-line);
  font-family: 'Crete Round', serif;
}
.wd-rules .game-h1 {
  font-family: 'Crete Round', serif;
  font-weight: 400;
  font-size: 46px;
  text-align: center;
  margin: 0 0 4px;
}
.wd-rules h2 {
  font-family: 'Crete Round', serif;
  font-weight: 400;
  font-size: 30px;
  text-align: center;
  opacity: 0.85;
  margin: 0 0 24px;
}
.wd-rules .prose { max-width: 62ch; margin: 0 auto; opacity: 0.92; line-height: 1.6; }
.wd-rules .prose p { color: inherit; }
