/* ==========================================================
   HISTORIANDO — Estilos compartilhados
   Tema: papel antigo / arqueologia (ocre, marrom, dourado)
   ========================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'Segoe UI', 'Trebuchet MS', sans-serif;
  background: linear-gradient(135deg, #8b5a2b 0%, #b88247 50%, #d4a574 100%);
  min-height: 100vh;
  padding: 20px;
  color: #3a2818;
}
.container {
  max-width: 780px;
  margin: 0 auto;
  background: #fef8ed;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(60, 30, 10, 0.35), inset 0 0 0 2px #c9a86b;
  position: relative;
  background-image:
    radial-gradient(circle at 10% 8%, rgba(201, 168, 107, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 22%, rgba(201, 168, 107, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 78%, rgba(201, 168, 107, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 88%, rgba(201, 168, 107, 0.08) 0 2px, transparent 3px);
}
h1 { color: #6b3a15; margin-bottom: 4px; font-size: 26px; text-align: center; }
.sub { color: #8b5a2b; text-align: center; margin-bottom: 18px; font-size: 14px; font-style: italic; }

/* ============ HEADER PLAYER ============ */
.header-player {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #fff4dc, #ffe8ba);
  border-radius: 16px;
  padding: 12px 14px; margin-bottom: 16px;
  border: 2px solid #d4a574;
}
.hp-avatar {
  position: relative;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #c9a86b;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.14);
  flex-shrink: 0; font-size: 34px;
}
.hp-main { flex: 1; min-width: 0; }
.hp-topo {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #6b3a15; font-weight: 700; margin-bottom: 4px;
}
.hp-moedas {
  background: #fff; padding: 3px 10px; border-radius: 12px;
  border: 1.5px solid #d4a574; color: #8b5a2b; font-weight: 700;
  font-size: 13px;
}
.hp-xp-bar {
  background: #fff; border: 2px solid #c9a86b; border-radius: 10px;
  height: 14px; overflow: hidden;
}
.hp-xp-fill {
  background: linear-gradient(90deg, #d4a574, #b88247, #8b5a2b);
  height: 100%; transition: width 0.5s ease-out;
  border-radius: 8px;
}
.hp-rodape {
  display: flex; gap: 10px; margin-top: 6px;
  font-size: 12px; color: #6b3a15; align-items: center;
  flex-wrap: wrap;
}

/* ============ CARDS DE JOGOS ============ */
.jogos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.jogo-card {
  background: linear-gradient(135deg, #fff4dc, #ffe8ba);
  border: 2.5px solid #d4a574;
  border-radius: 16px;
  padding: 16px 14px 14px;
  cursor: pointer;
  transition: all 0.22s;
  text-align: center;
  position: relative;
}
.jogo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(139, 90, 43, 0.28);
  border-color: #8b5a2b;
}
.jogo-card .emoji { font-size: 38px; line-height: 1; margin-bottom: 6px; }
.jogo-card .titulo { font-size: 15px; font-weight: 800; color: #6b3a15; margin-bottom: 4px; }
.jogo-card .desc { font-size: 12px; color: #8b5a2b; line-height: 1.35; min-height: 34px; }
.jogo-card .progresso {
  margin-top: 8px; font-size: 12px; font-weight: 700;
  color: #6b3a15; min-height: 16px;
}
.jogo-card .estrelas {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: #fff; border: 1.5px solid #d4a574; color: #8b5a2b;
  font-size: 12px; font-weight: 700;
}

/* ============ JOGO ATIVO (tela do jogo) ============ */
.jogo-area {
  background: #fef8ed;
  border: 2.5px solid #d4a574;
  border-radius: 18px;
  padding: 20px 16px;
  margin-top: 14px;
  position: relative;
  min-height: 360px;
}
.jogo-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.jogo-titulo-atual { font-size: 17px; font-weight: 800; color: #6b3a15; }
.jogo-contador {
  background: #fff4dc; padding: 4px 12px; border-radius: 12px;
  border: 1.5px solid #d4a574; font-size: 13px; font-weight: 700; color: #6b3a15;
}
.btn-voltar {
  background: #fff; border: 2px solid #c9a86b;
  color: #6b3a15; padding: 6px 12px; border-radius: 10px;
  font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn-voltar:hover { background: #fff4dc; }

.pergunta {
  background: linear-gradient(135deg, #fff4dc, #ffe8ba);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
  font-size: 16px; font-weight: 700; color: #3a2818;
  border: 2px solid #d4a574; line-height: 1.45;
}
.pergunta .hint {
  display: block; margin-top: 6px; font-size: 13px; font-weight: 500;
  color: #8b5a2b; font-style: italic;
}

.opcoes { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .opcoes.grid2 { grid-template-columns: 1fr 1fr; } }
.opcao {
  background: #fff;
  border: 2.5px solid #d4a574;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px; font-weight: 600; color: #3a2818;
  cursor: pointer; text-align: left;
  transition: all 0.18s;
  font-family: inherit; width: 100%;
  line-height: 1.35;
}
.opcao:hover:not(:disabled) {
  background: #fff4dc; border-color: #8b5a2b;
  transform: translateX(3px);
}
.opcao.acerto {
  background: linear-gradient(135deg, #c7f0a8, #a8e6b8);
  border-color: #4a8f5a; color: #1b4a2a;
}
.opcao.erro {
  background: linear-gradient(135deg, #ffd0d0, #ffb8b8);
  border-color: #c04040; color: #6a2020;
}
.opcao:disabled { cursor: default; }
.opcao .marca { float: right; font-size: 18px; font-weight: 800; }

.feedback {
  text-align: center; padding: 10px 14px; margin-top: 12px;
  border-radius: 12px; font-weight: 700; font-size: 15px;
  animation: fb-in 0.3s ease-out;
}
.feedback.ok  { background: #e0f7dc; color: #2a6a2a; border: 1.5px solid #4a8f5a; }
.feedback.erro { background: #ffe0e0; color: #7a2020; border: 1.5px solid #c04040; }
@keyframes fb-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback .explica {
  display: block; font-size: 13px; font-weight: 500; margin-top: 4px;
  font-style: italic; line-height: 1.35;
}

/* ============ TELAS DE FIM / CELEBRACAO ============ */
.fim {
  text-align: center; padding: 20px 12px;
}
.fim .emoji { font-size: 72px; margin-bottom: 8px; animation: pulse 1.2s infinite; }
.fim h2 { color: #6b3a15; font-size: 22px; margin-bottom: 8px; }
.fim .stats {
  display: flex; gap: 14px; justify-content: center; margin: 16px 0;
  flex-wrap: wrap;
}
.fim .stat {
  background: #fff4dc; padding: 10px 14px; border-radius: 12px;
  border: 2px solid #d4a574; min-width: 100px;
}
.fim .stat-n { font-size: 22px; font-weight: 800; color: #6b3a15; }
.fim .stat-l { font-size: 11px; color: #8b5a2b; text-transform: uppercase; letter-spacing: 0.5px; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============ BOTOES ============ */
.btn {
  background: linear-gradient(135deg, #d4a574, #b88247);
  color: #fff; border: none; padding: 12px 22px;
  border-radius: 12px; font-weight: 800; cursor: pointer;
  font-size: 15px; transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(139, 90, 43, 0.35);
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(139, 90, 43, 0.5); }
.btn.secundario {
  background: #fff; color: #6b3a15;
  border: 2px solid #c9a86b;
  box-shadow: none;
}

/* ============ MASCOTE WRAP ============ */
.mascote-wrap {
  text-align: center; margin: 4px 0 12px;
  position: relative; user-select: none;
}
.mascote-holder { display: inline-block; line-height: 0; }
.mascote-holder svg.mascote {
  width: 180px; max-width: 55%; height: auto;
  animation: mascoteBounce 3.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(107, 55, 20, 0.35));
  cursor: pointer; transition: transform 0.25s;
}
.mascote-holder svg.mascote:hover { transform: scale(1.05) rotate(2deg); }
@keyframes mascoteBounce {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-8px) rotate(1.2deg); }
}

.mascote-balao {
  display: inline-block; background: #fff;
  border: 2px solid #8b5a2b; color: #3a2818;
  padding: 6px 14px; border-radius: 18px;
  font-size: 13px; font-weight: 700;
  position: relative; margin-top: -4px;
  box-shadow: 0 3px 8px rgba(107, 55, 20, 0.18);
  animation: balaoFade 0.6s ease-out both;
  max-width: 280px; line-height: 1.35;
}
.mascote-balao::before {
  content: ''; position: absolute; top: -9px; left: 50%;
  transform: translateX(-50%); width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 9px solid #8b5a2b;
}
.mascote-balao::after {
  content: ''; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%); width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 7px solid #fff;
}
@keyframes balaoFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ SELETOR DE MASCOTES ============ */
.mascote-seletor {
  display: flex; gap: 8px; justify-content: center;
  margin: 10px 0 4px; flex-wrap: wrap;
}
.mascote-seletor-label {
  font-size: 11px; color: #8b5a2b; text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700;
  text-align: center; margin-top: 6px;
}
.mini-mascote {
  width: 62px; height: 66px;
  border: 2.5px solid #d4a574;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff4dc, #ffe8ba);
  cursor: pointer; padding: 2px;
  transition: all 0.2s;
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.mini-mascote:hover {
  border-color: #8b5a2b;
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(139, 90, 43, 0.25);
}
.mini-mascote.ativo {
  border-color: #6b3a15;
  background: linear-gradient(135deg, #ffe8ba, #d4a574);
  box-shadow: 0 0 0 3px rgba(107, 55, 20, 0.22);
}
.mini-mascote svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.mini-mascote svg, .mini-mascote svg * {
  animation: none !important; filter: none !important; transform: none !important;
}
.mini-mascote .mini-nome {
  position: absolute; bottom: 1px; left: 0; right: 0;
  font-size: 8px; font-weight: 700; color: #6b3a15;
  background: rgba(255, 244, 220, 0.9); padding: 1px 0;
  text-align: center;
}
.mini-mascote.ativo::after {
  content: '✓'; position: absolute; top: -6px; right: -6px;
  background: #6b3a15; color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ============ COACH DO MASCOTE (in-game) ============ */
.mascote-coach {
  position: fixed;
  bottom: 14px; right: 14px;
  z-index: 40;
  pointer-events: none;
}
.mascote-coach svg {
  width: 100px; height: auto; display: block;
  filter: drop-shadow(0 4px 10px rgba(107, 55, 20, 0.45));
  transition: transform 0.35s;
}
.mascote-coach.pulando svg { animation: coachPula 0.55s ease-out; }
@keyframes coachPula {
  0% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-28px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(0); }
}
.mascote-coach.tristonho svg { transform: rotate(-8deg); filter: grayscale(0.25) drop-shadow(0 4px 10px rgba(107, 55, 20, 0.45)); }

.mascote-coach .balao {
  position: absolute; bottom: 100%; right: 10px;
  background: #fff; border: 2px solid #8b5a2b; color: #3a2818;
  padding: 6px 12px; border-radius: 14px;
  font-size: 12px; font-weight: 700;
  white-space: normal; max-width: 210px;
  margin-bottom: 6px; pointer-events: none;
  animation: balaoFade 0.35s ease-out both;
  text-align: center; line-height: 1.3;
}
.mascote-coach .balao.verde { border-color: #4a8f5a; color: #1b4a2a; background: #eef9e8; }
.mascote-coach .balao.vermelho { border-color: #c04040; color: #7a2020; background: #ffeaea; }
.mascote-coach .balao::after {
  content: ''; position: absolute; bottom: -8px; right: 20px;
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid #8b5a2b;
}

/* ============ LINHA DO TEMPO (drag to order) ============ */
.linha-tempo {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center;
  padding: 14px; background: #fff4dc;
  border: 2px dashed #d4a574; border-radius: 14px;
  margin-bottom: 14px;
  min-height: 130px;
}
.linha-tempo .item {
  background: #fff; border: 2.5px solid #d4a574;
  border-radius: 10px; padding: 10px 12px;
  cursor: grab; min-width: 120px; text-align: center;
  font-weight: 700; font-size: 13px; color: #3a2818;
  user-select: none;
  transition: all 0.18s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.linha-tempo .item:hover { transform: translateY(-2px); border-color: #8b5a2b; }
.linha-tempo .item .emoji { font-size: 26px; line-height: 1; }
.linha-tempo .item.arrastando { opacity: 0.4; }
.linha-tempo .item.alvo { border-color: #4a8f5a; background: #eef9e8; }

.linha-tempo-legenda {
  text-align: center; font-size: 12px; color: #8b5a2b;
  margin-top: -6px; margin-bottom: 10px; font-style: italic;
}

.setas-tempo { display: flex; gap: 2px; justify-content: center; margin-bottom: 10px; font-size: 12px; color: #8b5a2b; }

/* ============ CLASSIFICAÇÃO (drag into 2 buckets) ============ */
.classif-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (min-width: 620px) {
  .classif-wrap { grid-template-columns: 1fr 1fr; }
}
.classif-bucket {
  background: #fff4dc;
  border: 2.5px dashed #d4a574;
  border-radius: 14px;
  padding: 10px 10px 12px;
  min-height: 130px;
}
.classif-bucket.drop-ativo { border-color: #4a8f5a; background: #eef9e8; }
.classif-bucket h3 {
  text-align: center; font-size: 14px; color: #6b3a15;
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.classif-bucket .itens { display: flex; flex-direction: column; gap: 6px; }

.classif-pool {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; padding: 10px;
  background: #fef8ed; border: 2px dashed #c9a86b;
  border-radius: 12px; margin-bottom: 12px;
  min-height: 52px;
}
.classif-chip, .classif-bucket .itens .classif-chip {
  background: #fff; border: 2px solid #d4a574;
  border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-weight: 600; color: #3a2818;
  cursor: grab; user-select: none;
  transition: all 0.15s;
}
.classif-chip:hover { border-color: #8b5a2b; }
.classif-chip.arrastando { opacity: 0.4; }
.classif-chip.ok { background: #eef9e8; border-color: #4a8f5a; color: #1b4a2a; }
.classif-chip.err { background: #ffeaea; border-color: #c04040; color: #7a2020; }

/* ============ VERDADEIRO × FALSO ============ */
.vf-btn {
  padding: 20px 14px !important;
  text-align: center !important;
  font-size: 17px;
}
.vf-btn.vf-v { background: linear-gradient(135deg, #eef9e8, #d4f0c9); border-color: #4a8f5a; color: #1b4a2a; }
.vf-btn.vf-f { background: linear-gradient(135deg, #ffeaea, #ffd0d0); border-color: #c04040; color: #6a2020; }
.vf-btn:hover:not(:disabled) { transform: scale(1.03); }

/* ============ CLOZE (completar lacuna) ============ */
.cloze-gap {
  display: inline-block;
  background: #ffd36b;
  color: #6b3a15;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 800;
  border-bottom: 3px solid #b88247;
  margin: 0 2px;
  letter-spacing: 1px;
}
.cloze-opt { text-align: center; font-weight: 700; }

/* ============ MEMÓRIA (pares) ============ */
.memoria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 520px) {
  .memoria-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}
.mem-carta {
  position: relative;
  min-height: 92px;
  border-radius: 12px;
  cursor: pointer;
  perspective: 600px;
  user-select: none;
}
.mem-carta .mem-back, .mem-carta .mem-front {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  padding: 8px;
  font-weight: 700; font-size: 13px;
  text-align: center;
  backface-visibility: hidden;
  transition: transform 0.4s;
  line-height: 1.25;
}
.mem-carta .mem-back {
  background: linear-gradient(135deg, #8b5a2b, #b88247);
  color: #ffd36b;
  font-size: 32px;
  border: 2px solid #6b3a15;
}
.mem-carta .mem-front {
  background: #fff4dc;
  color: #6b3a15;
  border: 2px solid #d4a574;
  transform: rotateY(180deg);
}
.mem-carta.virada .mem-back { transform: rotateY(-180deg); }
.mem-carta.virada .mem-front { transform: rotateY(0); }
.mem-carta.acertada .mem-front {
  background: linear-gradient(135deg, #d4f0c9, #a8e088);
  border-color: #4a8f5a;
  color: #1b4a2a;
  animation: memPulse 0.5s ease-out;
}
@keyframes memPulse {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(0) scale(1.1); }
  100% { transform: rotateY(0) scale(1); }
}

/* ============ RESPONSIVO ============ */
@media (max-width: 520px) {
  body { padding: 10px; }
  .container { padding: 18px 14px; border-radius: 16px; }
  h1 { font-size: 22px; }
  .jogos-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jogo-card { padding: 12px 8px 10px; }
  .jogo-card .emoji { font-size: 30px; }
  .jogo-card .titulo { font-size: 13px; }
  .jogo-card .desc { font-size: 11px; min-height: 0; }
  .mascote-coach svg { width: 80px; }
  .mascote-coach .balao { max-width: 160px; font-size: 11px; }
}
