/* ==================================================
   RONI QUIZ GAME — ESTILOS
   ================================================== */

/* ---------- Variáveis ---------- */
:root {
  --azul-profundo: #1e1b4b;
  --roxo: #4c1d95;
  --roxo-claro: #7c3aed;
  --ciano: #22d3ee;
  --amarelo: #fbbf24;
  --verde: #22c55e;
  --vermelho: #ef4444;
  --branco: #ffffff;
  --cinza-suave: #f1f5f9;
  --texto-escuro: #1f2937;
  --sombra: 0 20px 45px rgba(2, 6, 23, 0.35);
  --raio: 24px;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", sans-serif;
  color: var(--branco);
  background: radial-gradient(ellipse at top, #312e81 0%, var(--azul-profundo) 45%, #0f172a 100%);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Estrutura ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-header {
  padding: 18px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand i {
  color: var(--amarelo);
  font-size: 1.5rem;
}

.app-footer {
  padding: 18px 4px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ---------- Telas ---------- */
.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: surgir 0.45s ease both;
}

@keyframes surgir {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Cartões ---------- */
.card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 28px;
  margin: 12px 0;
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.card-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

/* ---------- Tela inicial ---------- */
.mascote {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ciano), var(--roxo-claro));
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  color: var(--branco);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: flutuar 3s ease-in-out infinite;
}

@keyframes flutuar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.game-title {
  font-family: "Baloo 2", cursive;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--amarelo), var(--ciano));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: 1.05rem;
  opacity: 0.9;
}

/* ---------- Botões ---------- */
.btn {
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--texto-escuro);
  border: none;
  border-radius: 16px;
  padding: 14px 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
  }

  .creditos-link:hover {
    transform: scale(1.1);
    filter: brightness(1.15);
  }
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--amarelo), #f59e0b);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.35);
  color: #451a03;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--branco);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-lg {
  font-size: 1.2rem;
  padding: 16px 34px;
}

/* ---------- Tela de introdução ---------- */
.intro-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.2);
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--ciano);
}

.intro-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  font-size: 1rem;
}

.intro-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.4;
}

.intro-list i {
  color: var(--ciano);
  margin-top: 3px;
}

/* ---------- Tela do quiz ---------- */
.card-quiz {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quiz-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.level-badge,
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.level-badge i { color: var(--ciano); }
.score-badge i { color: var(--amarelo); }

/* Barra de progresso */
.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ciano), var(--roxo-claro));
  transition: width 0.4s ease;
}

/* Pergunta */
.question-block {
  text-align: center;
  padding: 8px 4px;
}

.question-number {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.question-text {
  font-family: "Baloo 2", cursive;
  font-size: 1.5rem;
  line-height: 1.35;
  min-height: 3.2em;
}

/* Botões de resposta */
.answer-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.answer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 10px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--branco);
  cursor: pointer;
  font-family: "Baloo 2", cursive;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .answer-btn:hover {
    transform: translateY(-3px);
  }

  .answer-sim:hover { background: rgba(34, 197, 94, 0.35); box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3); }
  .answer-nao:hover { background: rgba(239, 68, 68, 0.35); box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3); }
}

.answer-btn:active {
  transform: scale(0.96);
}

.answer-icon {
  font-size: 2rem;
}

.answer-label {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
}

/* Estados acerto/erro */
.answer-btn.correto {
  border-color: var(--verde);
  background: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.answer-btn.errado {
  border-color: var(--vermelho);
  background: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

.answer-btn:disabled {
  cursor: default;
  transform: none;
}

/* Feedback */
.feedback {
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.feedback-result {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Baloo 2", cursive;
  font-size: 1.6rem;
  font-weight: 800;
}

.feedback-result.acertou { color: var(--verde); }
.feedback-result.errou { color: var(--vermelho); }

.feedback-explicacao {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.45;
  font-size: 0.95rem;
}

/* ---------- Tela fim de jogo ---------- */
.fim-icone {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amarelo), #f59e0b);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  color: #451a03;
  animation: flutuar 3s ease-in-out infinite;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Baloo 2", cursive;
  font-size: 1.7rem;
  font-weight: 800;
  background: conic-gradient(var(--ciano) 0%, rgba(255, 255, 255, 0.12) 0);
  margin: 6px auto;
}

.score-circle > span {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--azul-profundo);
  display: grid;
  place-items: center;
}

.classificacao {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: "Baloo 2", cursive;
  font-size: 1.2rem;
  font-weight: 800;
}

.classificacao.excelente { background: rgba(34, 197, 94, 0.25); color: var(--verde); border: 2px solid var(--verde); }
.classificacao.intermediario { background: rgba(251, 191, 36, 0.2); color: var(--amarelo); border: 2px solid var(--amarelo); }
.classificacao.inadequado { background: rgba(239, 68, 68, 0.2); color: var(--vermelho); border: 2px solid var(--vermelho); }

.fim-mensagem {
  font-size: 1.05rem;
  line-height: 1.5;
  opacity: 0.95;
}

.fim-botoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Tela de créditos ---------- */
.creditos-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.creditos-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: 1.1rem;
}

.creditos-nome {
  flex: 1;
  text-align: left;
}

.creditos-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0a66c2;
  color: var(--branco);
  font-size: 1.15rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.creditos-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #451a03;
}

/* ---------- Responsividade ---------- */
@media (max-width: 420px) {
  .game-title { font-size: 2.1rem; }
  .question-text { font-size: 1.3rem; }
  .answer-icon { font-size: 1.6rem; }
  .answer-label { font-size: 1.2rem; }
  .card { padding: 20px; }
}

/* ---------- Tablets em modo paisagem (altura reduzida) ---------- */
@media (orientation: landscape) and (max-height: 620px) {
  .app-header,
  .app-footer { padding: 10px 4px; }
  .card { padding: 18px; margin: 8px 0; }
  .mascote { width: 64px; height: 64px; font-size: 2rem; }
  .game-title { font-size: 2rem; }
  .answer-btn { padding: 14px 10px; }
  .feedback-explicacao { font-size: 0.9rem; }
}
