/* =========================================================
   WORD SEARCH (CAÇA-PALAVRAS) STYLES
   ========================================================= */

/* --- Menu --- */
.wordsearch-level-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 1.2rem;
}

.ws-level-card {
  background: white;
  border-radius: var(--border-radius-xl);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,0.1);
  border: 4px solid white;
  transition: transform 0.1s;
  position: relative;
  overflow: hidden;
}
.ws-level-card:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(0,0,0,0.1) !important; }
.ws-level-card.easy   { border-color: var(--color-green);  box-shadow: 0 8px 0 #04A87B; }
.ws-level-card.medium { border-color: var(--color-blue);   box-shadow: 0 8px 0 #008AA8; }
.ws-level-card.hard   { border-color: var(--color-purple); box-shadow: 0 8px 0 #7A35B3; }
.ws-level-card.locked { opacity: 0.65; cursor: default; filter: grayscale(0.3); }

.ws-level-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  color: white;
}
.ws-level-info { flex: 1; }
.ws-level-info h4 { font-size: 1.3rem; margin-bottom: 3px; }
.ws-level-info p  { font-size: 0.85rem; font-weight: 700; color: var(--text-light); }
.ws-level-meta {
  display: flex; gap: 8px; margin-top: 8px;
}
.ws-badge {
  background: #f0f4f8;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
}
.ws-lock { font-size: 1.8rem; }

/* --- Game Screen --- */
#view-wordsearch-game {
  padding-bottom: 110px;
}

.ws-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem 0.5rem;
  gap: 8px;
}
.ws-stat {
  background: white;
  border-radius: 14px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 5px;
}
.ws-stat ion-icon { font-size: 1rem; }
.ws-stat .val { color: var(--color-primary); }

/* Words to find list */
.ws-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 1.2rem;
  margin-bottom: 8px;
}
.ws-word-chip {
  background: white;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
  border: 2px solid #e8f0f8;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ws-word-chip.found {
  background: var(--color-green);
  color: white;
  border-color: #04A87B;
  box-shadow: 0 3px 0 #04A87B;
  text-decoration: line-through;
  opacity: 0.8;
}

/* Grid */
.ws-grid-wrapper {
  padding: 0 1.2rem;
  margin-top: 4px;
}

#ws-grid {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  background: white;
  border-radius: var(--border-radius-md);
  border: 4px solid white;
  box-shadow: 0 8px 0 rgba(0,0,0,0.12);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  position: relative;
}

.ws-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-main);
  background: transparent;
  border: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}
.ws-cell.selecting {
  background: rgba(255, 209, 102, 0.55) !important;
  color: #8B4513;
}
.ws-cell.found-0  { background: #06D6A0 !important; color: white !important; }
.ws-cell.found-1  { background: #00B4D8 !important; color: white !important; }
.ws-cell.found-2  { background: #9D4EDD !important; color: white !important; }
.ws-cell.found-3  { background: #FF416C !important; color: white !important; }
.ws-cell.found-4  { background: #FF9A3C !important; color: white !important; }
.ws-cell.found-5  { background: #FFD166 !important; color: #8B4513 !important; }
.ws-cell.found-6  { background: #4361EE !important; color: white !important; }
.ws-cell.found-7  { background: #ef233c !important; color: white !important; }
.ws-cell.found-8  { background: #06D6A0 !important; color: white !important; }
.ws-cell.found-9  { background: #00B4D8 !important; color: white !important; }
.ws-cell.found-10 { background: #9D4EDD !important; color: white !important; }
.ws-cell.found-11 { background: #FF416C !important; color: white !important; }
.ws-cell.found-12 { background: #FF9A3C !important; color: white !important; }
.ws-cell.found-13 { background: #4361EE !important; color: white !important; }

/* Win screen */
#ws-win-screen {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center;
}
#ws-win-screen.active { display: flex; }
.ws-win-card {
  background: white;
  border-radius: 32px;
  padding: 36px 28px;
  text-align: center;
  max-width: 340px; width: 90%;
  border: 6px solid var(--color-green);
  box-shadow: 0 12px 0 #04A87B;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
.ws-win-emoji { font-size: 5rem; display: block; margin-bottom: 14px; animation: bounce 0.6s infinite alternate; }
.ws-win-card h2 { font-size: 2.2rem; color: var(--color-green); margin-bottom: 8px; }
.ws-win-card p  { font-size: 1rem; font-weight: 700; color: var(--text-light); margin-bottom: 20px; }

/* Hint Button */
.ws-hint-btn {
  background: var(--color-secondary);
  color: #8B4513;
  border: none;
  border-radius: 14px;
  padding: 6px 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--color-secondary-dark);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ws-hint-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--color-secondary-dark); }
