/* =============================================
   TELA-HISTORIA-DETALHE.CSS — Ficha compacta da história
   Escopo: #tela-historia-detalhe .detalhe-*
   ============================================= */

/* ---- Tela base ---- */
#tela-historia-detalhe {
  background-image: url('../assets/img/telas/tela-historia-1/fundo.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: local;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---- Botões topo absolutos ---- */
#tela-historia-detalhe .detalhe-btn-topo {
  position: absolute;
  top: clamp(10px, 2svh, 18px);
  width: clamp(50px, 13vw, 68px);
  height: clamp(50px, 13vw, 68px);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

#tela-historia-detalhe .detalhe-btn-topo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#tela-historia-detalhe .detalhe-btn-topo:active { transform: scale(0.88); }
#tela-historia-detalhe .detalhe-btn-retornar    { left: 12px; }
#tela-historia-detalhe .detalhe-btn-config      { right: 12px; }

/* ---- Banner principal — pode ser grande, é o único que ocupa largura total ---- */
#tela-historia-detalhe .detalhe-banner-topo {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  object-fit: contain;
  margin-top: clamp(70px, 11svh, 90px);
  margin-bottom: 8px;
  align-self: center;
}

#tela-historia-detalhe .detalhe-banner-fb {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin-top: clamp(70px, 11svh, 90px);
  margin-bottom: 8px;
  padding: 16px 20px;
  background: linear-gradient(160deg, #1a3a6a, #0f2340);
}

#tela-historia-detalhe .detalhe-banner-fb-titulo {
  color: #f6c65b;
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* ---- Área de conteúdo — ficha compacta ---- */
#tela-historia-detalhe .detalhe-conteudo {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 14px 0;
  flex: 1;
}

/* ---- Bloco de seção compacto ---- */
#tela-historia-detalhe .detalhe-bloco {
  width: 100%;
  background: rgba(255, 245, 224, 0.97);
  border: 1.5px solid rgba(218, 169, 74, 0.95);
  border-radius: 14px;
  padding: 7px 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

#tela-historia-detalhe .detalhe-bloco-linha {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Ícone de seção: sempre 42 × 42 px, NUNCA mais que isso */
#tela-historia-detalhe .detalhe-bloco-icone {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  flex: 0 0 42px;
  display: block;
}

#tela-historia-detalhe .detalhe-bloco-main {
  flex: 1;
  min-width: 0;
}

#tela-historia-detalhe .detalhe-bloco-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 5px;
}

#tela-historia-detalhe .detalhe-bloco-titulo {
  margin: 0;
  color: #4a2a0a;
  font-size: 0.82rem;
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

#tela-historia-detalhe .detalhe-seta {
  color: #b77713;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

#tela-historia-detalhe .detalhe-bloco-corpo {
  color: #4e3112;
  font-size: 0.78rem;
  line-height: 1.28;
  font-weight: 700;
}

#tela-historia-detalhe .detalhe-bloco-corpo p {
  margin: 0;
}

/* ---- Chips ---- */
#tela-historia-detalhe .detalhe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#tela-historia-detalhe .detalhe-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3ead3;
  border: 1px solid #d8b26b;
  color: #5a3612;
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
}

#tela-historia-detalhe .detalhe-chip-azul {
  background: #edf4ff;
  border-color: #b3c9e8;
  color: #173b6d;
}

#tela-historia-detalhe .detalhe-chip-verde {
  background: #eef7d8;
  border-color: #abc878;
  color: #365d1d;
}

#tela-historia-detalhe .detalhe-chip-laranja {
  background: #fff1df;
  border-color: #e3b16e;
  color: #8a4a12;
}

/* ---- Caixas de texto (citação, curiosidades, aprendizados) ---- */
#tela-historia-detalhe .detalhe-caixas {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#tela-historia-detalhe .detalhe-caixa-texto {
  width: 100%;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 0.76rem;
  line-height: 1.28;
  font-weight: 700;
  box-sizing: border-box;
}

#tela-historia-detalhe .detalhe-caixa-azul {
  background: #eef5ff;
  border: 1px solid #b8cdeb;
  color: #173b6d;
}

#tela-historia-detalhe .detalhe-caixa-amarela {
  background: #fff8e8;
  border: 1px solid #e8bd5b;
  color: #5c3a0b;
  font-style: normal;
}

/* ---- Botões Ler Agora / Quiz ---- */
#tela-historia-detalhe .detalhe-acoes {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#tela-historia-detalhe .detalhe-btn-acao {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
  line-height: 0;
}

#tela-historia-detalhe .detalhe-btn-acao:active:not(:disabled) { transform: scale(0.94); }

/* Apenas as imagens dentro dos botões de ação têm largura total */
#tela-historia-detalhe .detalhe-btn-acao img {
  width: 100%;
  max-height: 58px;
  object-fit: contain;
  display: block;
}

#tela-historia-detalhe .detalhe-btn-acao-fb {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #f0b331, #c49a28);
}

#tela-historia-detalhe .detalhe-btn-acao--bloqueado {
  opacity: 0.38;
  filter: grayscale(60%);
  cursor: not-allowed;
}

/* ---- Faixa do jogador — quebra padding para ir de borda a borda ---- */
#tela-historia-detalhe .detalhe-faixa-jogador {
  width: calc(100% + 28px);
  min-height: 64px;
  margin-top: 10px;
  margin-left: -14px;
  margin-right: -14px;
  padding: 8px 16px;
  background: rgba(47, 29, 16, 0.9);
  border-top: 1px solid rgba(214, 164, 71, 0.45);
  border-bottom: 1px solid rgba(214, 164, 71, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

#tela-historia-detalhe .detalhe-jogador-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#tela-historia-detalhe .detalhe-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #f0b331;
  overflow: hidden;
  background: #1a3a6a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tela-historia-detalhe .detalhe-avatar-img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  display: block;
}

#tela-historia-detalhe .detalhe-avatar-fb {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

#tela-historia-detalhe .detalhe-nome-jogador {
  font-size: 0.92rem;
  font-weight: 900;
  color: #fff8ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* ---- Botão Álbum ---- */
#tela-historia-detalhe .detalhe-album-biblico {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

#tela-historia-detalhe .detalhe-album-biblico:active { transform: scale(0.88); }

#tela-historia-detalhe .detalhe-album-biblico img {
  width: 58px;
  height: auto;
  object-fit: contain;
  display: block;
}

#tela-historia-detalhe .detalhe-album-fb {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 900;
  color: #f0b331;
  border: 2px solid #f0b331;
  border-radius: 12px;
  padding: 8px 12px;
}

#tela-historia-detalhe .detalhe-album-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f0b331;
  color: #4a2a0a;
  font-size: 0.68rem;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* ---- Landscape ---- */
@media (orientation: landscape) and (max-height: 520px) {
  #tela-historia-detalhe .detalhe-banner-topo { margin-top: 58px; margin-bottom: 4px; }
  #tela-historia-detalhe .detalhe-conteudo    { gap: 5px; padding: 0 10px; }
  #tela-historia-detalhe .detalhe-bloco       { padding: 5px 7px; }
  #tela-historia-detalhe .detalhe-bloco-icone { width: 36px; height: 36px; flex: 0 0 36px; max-width: 36px; max-height: 36px; }
  #tela-historia-detalhe .detalhe-faixa-jogador {
    width: calc(100% + 20px);
    margin-left: -10px;
    margin-right: -10px;
  }
}
