/* Estilos gerais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

/* Estilos das telas */
.tela {
  display: none;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/*Evita layout quebrado e textos colados */
.tela.ativa {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

/* Card principal */
.card {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  text-align: center;
  margin: 0 auto;
}

/* Títulos */
h1, h2 {
  color: #2d3748;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(120deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

/* Subtítulos */
.sub {
  color: #4a5568;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ==== ESTILO UNIVERSAL DOS BOTÕES ==== */
.btn,
button,
#tela-menu .quiz-buttons button,
.menu-botoes button {
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.5rem;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn:hover,
button:hover,
#tela-menu .quiz-buttons button:hover,
.menu-botoes button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
  opacity: 0.95;
}

/* Inputs (Login, Cadastro etc.) */
#tela-cadastro input,
#tela-cadastro input,
#tela-login input,
#tela-criar-quiz input[type="text"], /* Incluindo inputs de texto da criação */
#tela-criar-quiz input[type="number"] { /* Incluindo inputs de número da criação */
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #d0d0ff;
    margin-bottom: 12px;
    font-size: 1rem;
    text-align: left;
}

#tela-cadastro input:focus,
#tela-login input:focus,
#tela-criar-quiz input:focus { /* Adicionado foco para criar quiz */
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 6px rgba(102, 126, 234, 0.4);
}

/* ==== TELA SOBRE O JOGO - NOVOS ESTILOS PARA AUTORES E AVATARES ==== */
.authors-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; /* Espaçamento maior entre os membros */
    margin: 2.5rem 0;
}

.author-item {
    text-align: center;
    max-width: 100px;
}

.author-avatar {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid #764ba2; /* Cor de destaque */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.author-item p {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
    margin: 0;
}

.game-date {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-top: 2rem;
    display: block;
}

/* ==== ESTILOS PARA TELA CRIAÇÃO DE QUIZ ==== */

.config-quiz {
    display: flex;
    gap: 20px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.input-group {
    text-align: left;
}
.input-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
    font-size: 0.9rem;
}
.input-group input[type="number"] { /* Específico para campos de número */
    width: 150px; 
    text-align: center;
}
.input-help {
    display: block;
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: -5px;
}

#round-indicator {
    font-size: 1.2rem;
    font-weight: 700;
    color: #764ba2;
    margin-bottom: 1rem;
    padding: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.current-pairs {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    background: #f7fafc;
}
.current-pairs p {
    margin-bottom: 5px;
    padding: 5px 0;
    border-bottom: 1px dashed #edf2f7;
    font-size: 0.95rem;
}
.current-pairs strong {
    color: #2c5282;
}
/* Termos e Definições */
.termo, .definicao {
    padding: 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    /* Adicionado para que a definição possa aceitar o drop no espaço em branco */
    justify-content: center;
    text-align: center;
    flex-direction: column; 
    line-height: 1.2;
}

.termo {
    background: #ebf8ff;
    border-color: #90cdf4;
    font-weight: 600;
    color: #2c5282;
    cursor: grab; /* Indica que é arrastável */
}

.termo.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.definicao {
    background: #f0fff4;
    border-color: #9ae6b4;
    color: #276749;
    cursor: default; /* Definições não são arrastáveis */
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 0.9rem; /* Para caber o termo + definição */
}
.definicao.drag-over {
    background: #ccfceb; /* Cor mais clara para indicar drop */
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* ESTILOS DE ACERTO/ERRO NO DROP */
.definicao.matched {
    cursor: not-allowed; /* Não pode mais dropar */
    font-weight: bold;
    padding: 0.8rem;
    min-height: 80px; /* Aumenta um pouco para caber 2 linhas */
}

.definicao.matched strong {
    font-size: 1.1rem; /* Termo em destaque */
    color: #4a5568;
    margin-bottom: 0.2rem;
}

.definicao.correct {
    background: #90f4a8; /* Fundo verde mais escuro para acerto */
    border-color: #48bb78;
    color: #2f855a;
}

.definicao.incorrect {
    background: #f59696; /* Fundo vermelho mais escuro para erro */
    border-color: #f56565;
    color: #c53030;
}

/* Estilos para a pontuação animada */
#pontuacao.animate {
    transform: scale(1.2);
    color: #667eea;
    font-weight: bold;
}

/* === Deixar "Termos", "Definições" e "Rodada/Pontuação" brancos === */
.col h2,
.info,
.info span,
.info strong {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Evita que o navegador interprete o gesto como rolagem enquanto arrasta */
.termo {
  touch-action: none;
}

/* Estilo do clone que segue o dedo */
.dragging-clone {
  width: auto;
  min-width: 100px; /* ajusta conforme necessário */
  max-width: 220px;
  height: auto;
  z-index: 9999;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border-radius: 10px;
  background: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  text-align: center;
  transform-origin: center center;
  transition: transform 0.06s linear;
}


/* === Responsividade === */
@media (max-width: 992px) {
  body {
    padding: 15px;
  }
  .container {
    grid-template-columns: 1fr;
  }
  .col {
    width: 100%;
  }
  .info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  .btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px 16px;
  }
  .container {
    margin-top: 1rem;
    gap: 1rem;
  }
  .termo, .definicao {
    font-size: 0.9rem;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .card {
    border-radius: 15px;
    padding: 1rem;
  }
  h1 {
    font-size: 1.6rem;
  }
  h2 {
    font-size: 1.2rem;
  }
}

