.challenge-page,
.result {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 800px;
}

.tableau-link,
.tableau-result {
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
}

.tableau-link {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.tableau-result {
  background: #e0e0e0;
  border-radius: 8px;
  text-align: center;
}

.context,
.context-result {
  padding: 1.2rem;
  border-radius: 8px;
  line-height: 1.6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.context {
  margin-top: 5rem;
  background-color: #f9f1dc;  
  color: #1e3050;        
}

.context-result {
  background-color: #1e3050;          
}

/* CHALLENGE LAYOUT */
.card-challenge {
  width: 100%;
  padding: 2rem;
  background: none;
  box-shadow: none;
}

/* Top icon layout */
.topside {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.bonus-side{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.animal-side {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Images */
.animal-pic {
  width: 192px;
  height: 192px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  padding: 10px;
}

.big-heart,
.big-bonus-active,
.big-bonus-unactive {
  width: 72px;
  height: auto;
  padding: 8px;
  margin-bottom: 0.5rem;
  max-width: 100%;
  flex-shrink: 1;
  font-size: 3rem;
}

.big-heart {
  animation: bob 3s ease-in-out infinite;
}

.big-bonus-active {
  opacity: 1;
}

.big-bonus-unactive {
  opacity: 0.05;
}

/* Heart counter text */
.heart-side h5 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: #1e3050;
}

/* Small icons */
.small-heart {
  width: 48px;
  height: 48px;
  margin-left: 10px;
}

.small-bonus-icon{
  font-size: 1.5rem;
  margin-left: 1rem;
}

.challenge-retry-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #ff7675;
  color: white;
  font-size: 1.2rem;
  padding: 6px 8px;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  min-width: 24px;
  text-align: center;
  line-height: 1;
}

/* Animation */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Responsive for small screens */
@media (max-width: 600px) {
  .topside {
    flex-direction: column;
    align-items: center;
  }

  .bonus-side,
  .animal-side,
  .heart-side {
    flex: none;
    margin-bottom: 1rem;
  }
}

.with-bonus .topside {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.no-bonus .topside {
  justify-content: center; 
}

.heart-side h5 {
  color: rgb(255, 255, 255);
}

.heart-side {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.no-bonus .bonus-side {
  display: none !important;
}

/* Light mode fix */
@media (prefers-color-scheme: light) {
  .context-result {
    background-color: rgb(216, 239, 255);          
    color: black;
  }

  .tableau-result {
    background-color: #f7fcff; 
    color: #0d47a1;           
  }

  .heart-side h5 {
    color: rgb(0, 0, 0);
  }

  .challenge-retry-badge {
    background-color: #e17055;
  }
}

.animal-success-bg {
  background-color: #d4edda;
  border: 2px solid #28a745;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.animal-failure-bg {
  background-color: #f8d7da;
  border: 2px solid #dc3545;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .animal-success-bg {
    background-color: #1e4d2b;
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.2);
  }

  .animal-failure-bg {
    background-color: #4d1e1e;
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.2);
  }
}