/* Red Flag Challenge – screen-specific */

/* Question card (only real card in flow) */
.question-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 24px 20px 28px;
}

.question-progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.question-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(92, 69, 184, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}

.question-progress-fill {
  height: 100%;
  background: var(--brand-purple);
  border-radius: 2px;
  transition: width 0.35s ease;
  width: 0%;
}

.question-title {
  font-size: clamp(22px, 5.5vw, 26px);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text-dark);
}

.flag-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flag-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px solid var(--border-soft);
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  background: white;
  color: var(--text-dark);
}

.flag-option:active {
  transform: scale(0.97);
}

.flag-option.red {
  background: var(--flag-red-bg);
}

.flag-option.green {
  background: var(--flag-green-bg);
}

.flag-option.red.selected {
  border-color: var(--flag-red-accent);
  box-shadow: 0 0 0 3px rgba(237, 92, 104, 0.25);
  transform: scale(1.03);
}

.flag-option.green.selected {
  border-color: var(--flag-green-accent);
  box-shadow: 0 0 0 3px rgba(70, 168, 116, 0.25);
  transform: scale(1.03);
}

.flag-emoji {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
}

.flag-option.red.selected .flag-label {
  color: var(--flag-red-accent);
}

.flag-option.green.selected .flag-label {
  color: var(--flag-green-accent);
}

/* Wait screen */
.wait-body {
  text-align: center;
}

.wait-status-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(92, 69, 184, 0.06);
  border: 1px solid rgba(92, 69, 184, 0.1);
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}

.wait-status-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-purple);
  flex-shrink: 0;
  animation: waitPulse 1.6s ease-in-out infinite;
}

@keyframes waitPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

.wait-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.wait-status-card .wait-dots {
  display: inline-flex;
  gap: 1px;
  margin-left: -2px;
}

.wait-dots span {
  animation: dotPulse 1.4s infinite;
  opacity: 0.3;
}

.wait-dots span:nth-child(2) { animation-delay: 0.2s; }
.wait-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* Soft App promo (after invite sent) */
.wait-app-promo {
  margin-top: 24px;
  padding: 18px 20px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 244, 255, 0.88) 100%);
  border: 1px solid rgba(92, 69, 184, 0.12);
  box-shadow: 0 8px 24px rgba(92, 69, 184, 0.08);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.wait-app-promo.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wait-app-promo.hidden {
  display: none;
}

.wait-app-promo-kicker {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.wait-app-promo-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 30ch;
}

.wait-app-promo-divider {
  height: 1px;
  margin: 14px 0 12px;
  background: rgba(92, 69, 184, 0.1);
}

.wait-app-promo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(92, 69, 184, 0.22);
  background: #fff;
  color: var(--brand-purple);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.wait-app-promo-btn .app-cta-inner {
  gap: 7px;
}

.wait-app-promo-btn:active {
  transform: scale(0.98);
  background: rgba(92, 69, 184, 0.04);
  border-color: rgba(92, 69, 184, 0.32);
}

.wait-app-promo-btn .app-cta-apple {
  color: var(--brand-purple);
}

/* Reveal */
.reveal-body {
  text-align: center;
}

.score-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(92, 69, 184, 0.12);
  stroke-width: 11;
}

.score-ring-fill {
  fill: none;
  stroke: var(--brand-purple);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 0.9s ease-out;
}

.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--brand-purple);
}

.reveal-tier {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.reveal-detail {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.gap-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px 18px;
  text-align: left;
  margin-bottom: 22px;
}

.gap-card.hidden {
  display: none;
}

.gap-card-layout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.gap-card-avatar-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(92, 69, 184, 0.08);
  box-shadow: 0 0 0 2px rgba(92, 69, 184, 0.1);
}

.gap-card-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.24);
}

.gap-card-content {
  flex: 1;
  min-width: 0;
}

.gap-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gap-card-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
}

.gap-card-teaser {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 8px;
}

.reveal-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-reveal-cta {
  text-decoration: none;
  color: var(--cta-primary-text);
}

.app-cta-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-cta-apple {
  flex-shrink: 0;
  display: block;
}

.reveal-cta-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.45;
}

/* Confetti (high match only) */
.confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  opacity: 0.85;
  animation: confettiFall 2.5s ease-in forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 360px) {
  .flag-options {
    grid-template-columns: 1fr;
  }

  .flag-option {
    min-height: 100px;
    flex-direction: row;
    gap: 12px;
    padding: 16px 20px;
  }

  .flag-emoji {
    margin-bottom: 0;
  }
}
