/* ═══════════════════════════════════════════
   PUZZLES — Anagram · Sudoku · Crossword · 4-Pics · Word Search
   ═══════════════════════════════════════════ */

/* ── Puzzle modal body padding ── */
.puzzle-body { padding: 20px 24px; }

/* ── Category toggle (tab strip inside puzzle modal) ── */
.category-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 12px;
  padding: 4px;
}
.cat-btn {
  flex: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--ink3);
  transition: background var(--t-std), color var(--t-std);
}
.cat-btn.active             { background: var(--ink); color: var(--paper); }
.cat-btn:hover:not(.active) { background: var(--paper3); color: var(--ink2); }

/* ══════════════════
   WORD ANAGRAM
══════════════════ */
.letters-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.letter-tile {
  width: 44px; height: 48px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast), transform var(--t-fast);
}
.letter-tile:hover { background: var(--accent); transform: translateY(-2px); }
.letter-tile.used  { background: var(--paper3); color: var(--ink3); cursor: default; transform: none; }

.word-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.word-input {
  flex: 1;
  border: 1.5px solid var(--paper3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  background: white;
  outline: none;
  text-transform: uppercase;
  transition: border-color var(--t-std);
}
.word-input:focus       { border-color: var(--accent); }
.word-input.shake       { animation: shake 0.3s; border-color: var(--accent); }

.submit-word-btn {
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-std);
}
.submit-word-btn:hover { background: var(--accent); }

.found-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  margin-bottom: 8px;
}
.found-word {
  background: var(--green);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  animation: popIn 0.2s cubic-bezier(0.34,1.6,0.64,1);
}

.anagram-score { text-align: center; font-size: 13px; color: var(--ink3); padding-top: 8px; border-top: 1px solid var(--paper3); }
.anagram-score strong { font-family: 'Fraunces', serif; font-size: 18px; color: var(--ink); }

/* ══════════════════
   SUDOKU
══════════════════ */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: 100%;
  max-width: 400px;
  margin: 0 auto 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}
.sudoku-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: white;
  border-right: 1px solid var(--paper3);
  border-bottom: 1px solid var(--paper3);
  position: relative;
  transition: background var(--t-fast);
}
.sudoku-cell:nth-child(3n) { border-right: 2px solid var(--ink2); }
.sudoku-cell:nth-child(9n) { border-right: none; }
.sudoku-cell.given    { color: var(--ink);   background: var(--paper2); }
.sudoku-cell.player   { color: var(--blue); }
.sudoku-cell.selected { background: #e8f0fe !important; }
.sudoku-cell.error    { color: var(--accent) !important; }
.sudoku-cell.peer     { background: var(--paper2); }

.sudoku-numpad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto 16px;
}
.num-btn {
  aspect-ratio: 1;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 6px;
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast);
}
.num-btn:hover { background: var(--ink); color: white; }

.sudoku-actions {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}
.action-btn {
  flex: 1;
  padding: 10px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-std);
}
.action-btn:hover           { background: var(--paper3); }
.action-btn.primary         { background: var(--ink); color: white; border-color: var(--ink); }
.action-btn.primary:hover   { background: var(--accent); border-color: var(--accent); }

/* ══════════════════
   MINI CROSSWORD
══════════════════ */
.crossword-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.crossword-grid {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  grid-template-rows: repeat(5, 48px);
  gap: 2px;
  flex-shrink: 0;
}
.cw-cell {
  width: 48px; height: 48px;
  background: white;
  border: 1.5px solid var(--paper3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.cw-cell.black       { background: var(--ink); border-color: var(--ink); cursor: default; }
.cw-cell.selected    { border-color: var(--accent); background: #fef5f3; }
.cw-cell.highlighted { background: #fef9f0; }
.cw-cell.correct     { background: #d4edda; border-color: var(--green); color: var(--green); }

.cw-number {
  position: absolute;
  top: 2px; left: 3px;
  font-size: 8px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink3);
  line-height: 1;
}

.cw-clues         { flex: 1; min-width: 0; }
.cw-clues-section { margin-bottom: 12px; }
/* .cw-clues-title uses the shared eyebrow style from base.css */

.cw-clue {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.4;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.cw-clue:hover  { background: var(--paper2); }
.cw-clue.active { background: #fef5f3; color: var(--accent); font-weight: 500; }
.cw-clue span   { font-weight: 600; margin-right: 4px; }

/* ══════════════════
   4 PICS 1 WORD
══════════════════ */
.pics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.pic-cell {
  border-radius: 10px;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper3);
  border: 1.5px solid var(--paper3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.answer-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.answer-box {
  width: 40px; height: 44px;
  border: 2px solid var(--paper3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  background: white;
  transition: border-color var(--t-std);
}
.answer-box.filled   { border-color: var(--ink);   color: var(--ink); }
.answer-box.revealed { border-color: var(--gold);  color: var(--gold);  background: #fef9e7; }
.answer-box.correct  { border-color: var(--green); color: var(--green); background: #d4edda; }

.guess-input { display: flex; gap: 8px; margin-bottom: 12px; }
.guess-field {
  flex: 1;
  border: 1.5px solid var(--paper3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  text-transform: uppercase;
  outline: none;
  transition: border-color var(--t-std);
}
.guess-field:focus { border-color: var(--accent); }

.guess-btn {
  padding: 10px 18px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-std);
}
.guess-btn:hover { background: var(--accent); }

.hint-btn {
  width: 100%;
  padding: 10px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
  transition: background var(--t-std);
}
.hint-btn:hover   { background: var(--paper3); }
.hint-penalty     { font-size: 11px; color: var(--accent); margin-top: 4px; text-align: center; }

/* ══════════════════
   WORD SEARCH
══════════════════ */
.ws-theme        { text-align: center; font-size: 13px; color: var(--ink3); margin-bottom: 14px; }
.ws-theme strong { color: var(--ink); font-family: 'Fraunces', serif; }

.ws-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.ws-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  flex-shrink: 0;
  width: min(300px, 60vw);
  touch-action: none;
  user-select: none;
}
.ws-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: clamp(10px, 2.5vw, 15px);
  font-weight: 600;
  border-radius: 3px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-fast);
}
.ws-cell.found     { background: var(--green); color: white; border-color: var(--green); }
.ws-cell.selecting { background: #fef5f3; border-color: var(--accent); color: var(--accent); }

.ws-words {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ws-word {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  letter-spacing: 0.05em;
  transition: all 0.2s;
}
.ws-word.found {
  background: var(--green);
  color: white;
  border-color: var(--green);
  text-decoration: line-through;
  opacity: 0.75;
}
.ws-submit-btn { width: 100%; margin-top: 14px; }

/* ══════════════════
   COUNTDOWN SCREEN
══════════════════ */
.countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 64px;
  gap: 8px;
  min-height: 220px;
}
/* .countdown-label uses the shared eyebrow style from base.css */
.countdown-number {
  font-family: 'Fraunces', serif;
  font-size: 100px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  min-width: 130px;
  text-align: center;
}
.countdown-pop { animation: countdownPop 0.32s cubic-bezier(0.34,1.5,0.64,1); }
@keyframes countdownPop {
  from { transform: scale(1.5); opacity: 0.4; }
  to   { transform: scale(1);   opacity: 1;   }
}
