/* Daily Challenge — F31 */

.challenge-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Small streak banner — shown above the card on every active phase */
.streak-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3e0;
  color: #e65100;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.streak-banner .streak-flame { font-size: 1rem; }
.streak-banner .streak-count { font-size: 1rem; }
.streak-banner .streak-label { font-weight: 600; opacity: 0.85; }

/* Big streak display on complete/done screens */
.streak-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 16px;
  background: #fff3e0;
  border-radius: 12px;
}

.streak-big .streak-flame { font-size: 2rem; line-height: 1; }
.streak-big-count {
  font-size: 2.6rem;
  font-weight: 800;
  color: #e65100;
  line-height: 1;
}
.streak-big-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e65100;
}

.phase { width: 100%; display: flex; align-items: center; justify-content: center; }

.center-content {
  text-align: center;
  padding: 40px 20px;
}

.challenge-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 32px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.challenge-card h2 {
  font-size: 1.4rem;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.challenge-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.challenge-step-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);  /* default = not started */
}

.challenge-step-badge.status-success::before { background: #4caf50; }
.challenge-step-badge.status-fail::before    { background: #ff9800; }

.challenge-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.challenge-nav .nav-arrow {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brand-primary);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.challenge-nav .nav-arrow:hover:not(:disabled) {
  background: var(--brand-primary-light, #f0f0ff);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.challenge-nav .nav-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.challenge-hint-text {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.challenge-sub {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* GIF display */
.challenge-gif-wrap {
  margin: 16px auto;
  max-width: 320px;
}

.challenge-gif {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  background: #f0f0f0;
  min-height: 200px;
}

/* Multiple choice options */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.option-btn {
  padding: 14px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  color: var(--text-heading);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.option-btn:hover:not(.correct):not(.wrong):not(:disabled) {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.option-btn.correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #2e7d32;
}

.option-btn.wrong {
  border-color: #c62828;
  background: #ffebee;
  color: #c62828;
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.decipher-feedback {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
}

.decipher-feedback.correct-feedback {
  background: #e8f5e9;
  color: #2e7d32;
}

.decipher-feedback.wrong-feedback {
  background: #fff3e0;
  color: #e65100;
}

/* Sign to Make */
.challenge-word {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin: 16px 0;
}

.make-hint {
  margin: 12px auto;
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.4s ease-in;
}

.make-hint.visible {
  opacity: 1;
}

/* "Hint" button — visible from the start, but disabled with a
 * countdown ring until the user has had a moment to try signing first.
 * The ring fill animation is driven by JS via Web Animations API. */
#btn-show-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#btn-show-hint .hint-ring {
  display: none;
  flex-shrink: 0;
}

#btn-show-hint.hint-btn-pending .hint-ring {
  display: inline-block;
}

#btn-show-hint .hint-ring-track { stroke: rgba(0, 0, 0, 0.18); }
#btn-show-hint .hint-ring-fill  { stroke: currentColor; }

.service-msg {
  color: #888;
  font-size: 0.85rem;
  margin-top: 12px;
}

/* Camera/recording styles are in /shared/recorder.css.
 * Challenge needs the camera-container to be a fixed full-screen overlay
 * (vs. practice which has it inside the practice screen layout).
 */
#make-camera .camera-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
#make-camera .camera-cancel { z-index: 1001; }

/* Result icon */
.result-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.result-icon-circle.passed { background: #e8f5e9; color: #2e7d32; }
.result-icon-circle.failed { background: #ffebee; color: #c62828; }

.result-confidence {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.make-result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Complete */
.challenge-complete {
  padding: 48px 24px;
}

.trophy-svg {
  margin-bottom: 16px;
}

.done-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Spinner (matching shared) */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

.spinner.large { width: 48px; height: 48px; border-width: 4px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
  .challenge-main { padding: 16px 12px; }
  .challenge-card { padding: 24px 16px; max-width: 100%; }
  .challenge-card h2 { font-size: 1.25rem; }
  .challenge-word { font-size: 1.9rem; }
  .challenge-gif-wrap, .challenge-gif { max-width: 280px; }
  .option-btn { padding: 12px 6px; font-size: 0.95rem; }
  .countdown-value { font-size: 4.5rem; }
  .calibrate-box { padding: 24px; max-width: 92%; }
}

@media (max-width: 480px) {
  .option-grid { gap: 8px; }
  .option-btn { padding: 10px 4px; font-size: 0.85rem; }
  .challenge-word { font-size: 1.6rem; }
  .challenge-gif-wrap, .challenge-gif { max-width: 240px; }
}
