/* ==========================================================================
   CAÇA PALAVRAS DO HARDWARE & TI — ESTILOS CYBER-MATRIX
   ========================================================================== */

:root {
  --caca-bg: #050811;
  --caca-surface: #0a1120;
  --caca-surface-soft: #131f37;
  --caca-line: rgba(255, 255, 255, 0.12);
  --caca-text: #f8fafc;
  --caca-text-muted: #94a3b8;
  --caca-neon-cyan: #38bdf8;
  --caca-neon-green: #10b981;
  --caca-neon-purple: #a855f7;
  --caca-neon-gold: #f59e0b;
}

body.caca-app-body {
  background-color: var(--caca-bg);
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    linear-gradient(to bottom, #04060c, #090e1a);
  color: var(--caca-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.caca-container {
  max-width: 1180px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1.25rem 1rem 3.5rem 1rem;
}

/* Header */
.caca-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--caca-line);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.caca-logo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.caca-logo-icon {
  background: rgba(56, 189, 248, 0.15);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.caca-logo-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.caca-logo-text p {
  font-size: 0.78rem;
  color: var(--caca-text-muted);
  margin: 0.15rem 0 0 0;
}

/* Abas */
.caca-top-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.caca-nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--caca-line);
  padding: 0.25rem;
  border-radius: 10px;
  gap: 0.35rem;
}

.caca-nav-tab {
  background: transparent;
  border: none;
  color: var(--caca-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.caca-nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.caca-nav-tab.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.caca-nav-btn {
  background: var(--caca-surface);
  border: 1px solid var(--caca-line);
  color: var(--caca-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.caca-nav-btn:hover {
  background: var(--caca-surface-soft);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Card Geral */
.caca-card {
  background: var(--caca-surface);
  border: 1.5px solid var(--caca-line);
  border-radius: 16px;
  padding: 1.75rem;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

/* Barra de Controles (Categoria & Dificuldade) */
.caca-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--caca-line);
  padding-bottom: 1.25rem;
}

.opt-caca-btn {
  background: var(--caca-surface);
  border: 1.5px solid var(--caca-line);
  color: var(--caca-text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.opt-caca-btn:hover {
  background: var(--caca-surface-soft);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.opt-caca-btn.selected {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: var(--caca-neon-cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   LAYOUT DO JOGO (GRADE DE LETRAS + LISTA DE PALAVRAS)
   ========================================================================== */
.setup-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.85rem;
  letter-spacing: -0.01em;
}

.setup-section-title svg {
  flex-shrink: 0;
}

.caca-game-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 860px) {
  .caca-game-layout {
    grid-template-columns: 1fr;
  }
}

/* A Matriz de Letras */
.grid-board-wrapper {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--caca-line);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  touch-action: none;
  box-sizing: border-box;
  height: 100%;
}

.word-matrix-table {
  display: grid;
  gap: 4px;
  margin: 0 auto;
}

.matrix-cell {
  width: 36px;
  height: 36px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.1s ease;
}

@media (max-width: 600px) {
  .matrix-cell {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }
}

.matrix-cell:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--caca-neon-cyan);
}

/* Letra Selecionada no Arraste */
.matrix-cell.selecting {
  background: rgba(56, 189, 248, 0.45) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transform: scale(1.06);
}

/* Letra de Palavra Encontrada */
.matrix-cell.found {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Letra Dica (Laser Scan) */
.matrix-cell.hint-pulse {
  animation: hintLaserGlow 1.2s infinite alternate;
  background: rgba(245, 158, 11, 0.4) !important;
  border-color: #facc15 !important;
  color: #facc15 !important;
}

/* Painel Lateral: Lista de Palavras */
.caca-words-panel {
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--caca-line);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  box-sizing: border-box;
}

.words-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--caca-line);
  padding-bottom: 0.65rem;
}

.words-checklist-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.word-target-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--caca-line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  transition: all 0.2s ease;
}

.word-target-item.is-completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
  text-decoration: line-through;
  opacity: 0.85;
}

/* Botões de Ação */
.btn-caca-main {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-caca-main:hover {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.btn-caca-hint {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #facc15;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-caca-hint:hover {
  background: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Glossário */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.glossary-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--caca-line);
  border-radius: 10px;
  padding: 1.15rem;
}

@keyframes hintLaserGlow {
  0% { transform: scale(1); box-shadow: 0 0 5px #facc15; }
  100% { transform: scale(1.1); box-shadow: 0 0 20px #f59e0b; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Painel Didático: Pilha de Definições LIFO */
.caca-definitions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.caca-def-card {
  background: linear-gradient(135deg, rgba(10, 17, 32, 0.95), rgba(19, 31, 55, 0.9));
  border: 1.5px solid #10b981;
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
  animation: slideInFromTop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

