@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400&display=swap');

/* ── Language Bar ── */
.lang-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0 0;
}
.lang-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
}
.lang-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.12);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.18s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--pink); color: var(--text); }
[data-theme="light"] .lang-btn { border-color: rgba(100,80,180,0.2); }
.lang-active {
  border-color: var(--purple);
  color: var(--text);
  background: rgba(196,77,255,0.15);
}
.home-btn {
  margin-right: auto;
  opacity: 0.75;
  transition: opacity 0.18s, border-color 0.18s;
}
.home-btn:hover { opacity: 1; border-color: var(--purple); }

/* ── Theme toggle switch ── */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
  padding: 0;
}
.theme-toggle-thumb {
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), background 0.25s;
  z-index: 1;
}
.theme-toggle-icon {
  position: absolute;
  font-size: 0.75rem;
  line-height: 1;
  transition: opacity 0.2s;
}
.theme-toggle-moon { right: 5px; opacity: 1; }
.theme-toggle-sun  { left: 5px;  opacity: 0; }

/* Light mode state */
[data-theme="light"] .theme-toggle {
  background: rgba(255,220,80,0.2);
  border-color: rgba(255,183,77,0.4);
}
[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(24px);
  background: var(--warm);
}
[data-theme="light"] .theme-toggle-moon { opacity: 0; }
[data-theme="light"] .theme-toggle-sun  { opacity: 1; }

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink:        #f472b6;
  --purple:      #a855f7;
  --bg:          #0a0a12;
  --card:        #111120;
  --card-bg:     #111120;
  --card-border: rgba(255,255,255,0.09);
  --text:        #f1f0f7;
  --text-muted:  #9492b8;
  --muted:       #9492b8;
  --cold:        #38bdf8;
  --warm:        #fbbf24;
  --hot:         #f87171;
  --fire:        #ff1744;
  --input-bg:    rgba(255,255,255,0.06);
  --input-border:rgba(255,255,255,0.12);
  --sign-bg:     rgba(255,255,255,0.03);
  --sign-hover:  rgba(244,114,182,0.07);
  --sign-checked:rgba(244,114,182,0.14);
  --verdict-bg:  rgba(255,255,255,0.04);
  --verdict-border:rgba(255,255,255,0.09);
  --stat-bg:     rgba(255,255,255,0.04);
  --stat-border: rgba(255,255,255,0.08);
}

[data-theme="light"] {
  --bg:           #f8f7ff;
  --card:         #ffffff;
  --card-bg:      #ffffff;
  --card-border:  rgba(120,90,200,0.11);
  --text:         #16113a;
  --text-muted:   #5e5a8a;
  --muted:        #5e5a8a;
  --input-bg:     rgba(120,90,200,0.04);
  --input-border: rgba(120,90,200,0.18);
  --sign-bg:      rgba(120,90,200,0.03);
  --sign-hover:   rgba(244,114,182,0.07);
  --sign-checked: rgba(244,114,182,0.14);
  --verdict-bg:   rgba(120,90,200,0.04);
  --verdict-border:rgba(120,90,200,0.11);
  --stat-bg:      rgba(120,90,200,0.04);
  --stat-border:  rgba(120,90,200,0.1);
}

[data-theme="light"] body,
body[data-theme="light"] {
  background-image:
    radial-gradient(ellipse at 15% 60%, rgba(168,85,247,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(244,114,182,0.06) 0%, transparent 55%);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 15% 60%, rgba(168,85,247,0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(244,114,182,0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 95%, rgba(56,189,248,0.05) 0%, transparent 50%);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}
.emoji-big {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: wobble 3s ease-in-out infinite;
}
@keyframes wobble {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50%       { transform: rotate(3deg) scale(1.08); }
}
h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.highlight {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}
.cert-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,183,77,0.4);
  background: rgba(255,183,77,0.08);
  color: var(--warm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.18);
  transition: background 0.3s ease, border-color 0.3s ease;
}
[data-theme="light"] .card {
  box-shadow: 0 2px 16px rgba(100,80,200,0.07), 0 1px 3px rgba(0,0,0,0.05);
}
.card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ── Age Section ── */
.age-section {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.age-label {
  font-size: 0.95rem;
  color: var(--muted);
}
.age-label strong {
  color: var(--text);
  font-size: 1.1rem;
  margin-left: 0.25rem;
}
.age-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  outline: none;
  cursor: pointer;
}
.age-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--pink);
  box-shadow: 0 2px 8px rgba(255,107,157,0.4);
  cursor: pointer;
  transition: transform 0.15s;
}
.age-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.age-group-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: rgba(196,77,255,0.12);
  border: 1.5px solid rgba(196,77,255,0.3);
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 700;
  align-self: flex-start;
  transition: all 0.2s ease;
}

/* ── Gender Picker ── */
.gender-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
.gender-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.03);
}
.gender-option:hover {
  border-color: var(--pink);
  background: rgba(255,107,157,0.07);
  transform: translateY(-2px);
}
.gender-option input[type="radio"] { display: none; }
.gender-option.selected {
  border-color: var(--purple);
  background: rgba(196,77,255,0.12);
  box-shadow: 0 0 20px rgba(196,77,255,0.2);
}
.gender-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.gender-text { font-weight: 700; font-size: 1.05rem; text-align: center; }
.gender-sub  { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; text-align: center; }

/* ── Signs Grid ── */
.signs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 560px) {
  .signs-grid { grid-template-columns: 1fr 1fr; }
}
.sign-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--sign-bg);
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
}
.sign-item:hover {
  border-color: rgba(255,107,157,0.4);
  background: var(--sign-hover);
}
.sign-item input[type="checkbox"] { display: none; }
.sign-item.checked {
  border-color: var(--pink);
  background: var(--sign-checked);
  animation: checkBounce 0.25s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes checkBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.sign-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 1.8rem;
  text-align: center;
}
.sign-label { flex: 1; }

/* ── Weight Badges ── */
.weight-badge {
  font-size: 0.65rem;
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 0.5rem;
}
.w3 { color: #ff6b9d; }
.w2 { color: #ffb74d; }
.w1 { color: #8888aa; }

.weight-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.weight-pip { font-size: 0.7rem; letter-spacing: 1px; }

/* ── Counter Bar ── */
.counter-bar {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* ── Submit Button ── */
.btn-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-submit:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 30px rgba(168,85,247,0.5);
  animation: btnPulse 0.6s ease infinite alternate;
}
@keyframes btnPulse {
  from { box-shadow: 0 10px 35px rgba(255,107,157,0.45); }
  to   { box-shadow: 0 10px 45px rgba(196,77,255,0.6); }
}
.btn-submit:active { transform: translateY(0) scale(0.99); }

.submit-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 0.6rem;
}

/* ── Hidden ── */
.hidden { display: none !important; }

/* ── Stamp ── */
.stamp {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,183,77,0.5);
  color: var(--warm);
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  transform: rotate(12deg);
  opacity: 0.65;
  pointer-events: none;
  animation: stampIn 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes stampIn {
  from { transform: rotate(12deg) scale(2.5); opacity: 0; }
  to   { transform: rotate(12deg) scale(1);   opacity: 0.65; }
}

/* ── Result: Percentage Ring ── */
.result-card { text-align: center; position: relative; }

.percentage-wrapper {
  display: flex;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}
.percentage-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid;
  position: relative;
}
.ring-cold  { border-color: var(--cold);   box-shadow: 0 0 30px rgba(79,195,247,0.3); }
.ring-warm  { border-color: var(--warm);   box-shadow: 0 0 30px rgba(255,183,77,0.3); }
.ring-hot   { border-color: var(--hot);    box-shadow: 0 0 30px rgba(239,83,80,0.3); }
.ring-fire  {
  border-color: var(--fire);
  animation: firePulse 1s ease-in-out infinite alternate;
}
@keyframes firePulse {
  from { box-shadow: 0 0 35px rgba(255,23,68,0.5), 0 0 70px rgba(255,107,157,0.2); }
  to   { box-shadow: 0 0 55px rgba(255,23,68,0.8), 0 0 100px rgba(196,77,255,0.35); }
}

.percentage-num {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
}
.percentage-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  height: 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}
.bar-cold  { background: var(--cold); }
.bar-warm  { background: linear-gradient(90deg, var(--warm), #ff8a65); }
.bar-hot   { background: linear-gradient(90deg, var(--warm), var(--hot)); }
.bar-fire  { background: linear-gradient(90deg, var(--hot), var(--fire)); }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── Verdict Box ── */
.verdict-box {
  background: var(--verdict-bg);
  border: 1px solid var(--verdict-border);
  border-radius: 18px;
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}
.verdict-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.verdict-message {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.98rem;
  white-space: pre-line;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.stat-box {
  background: var(--stat-bg);
  border: 1px solid var(--stat-border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-num   { font-size: 1.8rem; font-weight: 800; }
.stat-label { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.stat-denom { font-size: 1rem; color: var(--muted); }

/* ── Custom Signs Section ── */
.btn-add-sign {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border: 2px dashed rgba(255,107,157,0.4);
  border-radius: 12px;
  background: rgba(255,107,157,0.06);
  color: var(--pink);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 0.75rem;
}
.btn-add-sign:hover {
  border-color: var(--pink);
  background: rgba(255,107,157,0.12);
  transform: translateY(-1px);
}

.custom-hint { margin-top: 0.5rem; display: block; }

.custom-sign-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.custom-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(196,77,255,0.2);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.custom-sign-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.18s, background 0.3s, box-shadow 0.18s;
  outline: none;
}
.custom-sign-input::placeholder { color: var(--muted); opacity: 0.7; }
.custom-sign-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

.btn-remove-sign {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-remove-sign:hover { background: rgba(239,83,80,0.25); color: var(--hot); }

/* ── Custom Signs Breakdown (result page) ── */
.custom-breakdown {
  margin-top: 1.5rem;
  text-align: left;
  background: rgba(196,77,255,0.06);
  border: 1px solid rgba(196,77,255,0.15);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.custom-breakdown h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--purple);
}
.custom-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.custom-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--stat-bg);
}
.custom-sign-text { flex: 1; color: var(--text); overflow-wrap: anywhere; min-width: 0; }

/* ── Carousel ── */
.carousel-wrapper { margin-top: 0.5rem; }

.carousel-progress {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
[data-theme="light"] .carousel-progress { background: rgba(100,80,180,0.1); }
.carousel-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 999px;
  transition: width 0.35s ease;
  width: 0%;
}
.carousel-counter {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.carousel-stage {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-card {
  background: var(--sign-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  width: 100%;
  text-align: center;
  position: relative;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.carousel-icon { font-size: 2.8rem; margin-bottom: 1rem; display: block; }
.carousel-text  { font-size: 1.02rem; line-height: 1.65; color: var(--text); }
.carousel-weight {
  font-size: 0.72rem;
}
.carousel-card .weight-tooltip-wrap {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  align-items: center;
}
.carousel-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  justify-content: center;
}
.btn-no, .btn-yes {
  flex: 1;
  max-width: 170px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.2px;
}
.btn-no {
  border: 2px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--muted);
}
[data-theme="light"] .btn-no { border-color: rgba(100,80,180,0.15); }
.btn-no:hover  { border-color: var(--hot); color: var(--hot); background: rgba(239,83,80,0.08); transform: scale(1.04) translateX(-3px); }
.btn-no:active { transform: scale(0.96) translateX(-6px); }
.btn-yes {
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 4px 16px rgba(196,77,255,0.3);
}
.btn-yes:hover  { transform: scale(1.04) translateX(3px); box-shadow: 0 6px 22px rgba(196,77,255,0.4); }
.btn-yes:active { transform: scale(0.96) translateX(6px); }
body[data-mode="redflag"] .btn-yes {
  background: linear-gradient(135deg, #ff3b3b, #ff6b2b);
  box-shadow: 0 4px 16px rgba(255,59,59,0.3);
}
body[data-mode="redflag"] .btn-yes:hover { box-shadow: 0 6px 22px rgba(255,59,59,0.45); }
.carousel-kb-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.75rem;
  opacity: 0.6;
  letter-spacing: 0.3px;
}

/* ── Confidence interval ── */
.confidence-interval {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
  opacity: 0.75;
  font-style: italic;
}

/* ── Devil's advocate ── */
.devil-toggle-row {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.5rem;
}
.devil-toggle-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1.5px dashed rgba(255,107,157,0.4);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.devil-toggle-btn:hover { border-color: var(--pink); color: var(--text); }
.devil-box { border: 1.5px dashed rgba(255,107,157,0.35); background: rgba(255,107,157,0.04); }

/* ── Troll sections (pie + fake stats) ── */
.troll-section {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  text-align: left;
}
[data-theme="light"] .troll-section { background: rgba(100,80,180,0.03); }
.troll-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pie-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.pie-chart {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--purple) 0% var(--pie-real),
    rgba(255,255,255,0.1) var(--pie-real) 100%
  );
}
[data-theme="light"] .pie-chart {
  background: conic-gradient(
    var(--purple) 0% var(--pie-real),
    rgba(100,80,180,0.1) var(--pie-real) 100%
  );
}
.pie-legend { flex: 1; min-width: 140px; }
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.pie-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pie-dot-real  { background: var(--purple); }
.pie-dot-bias  { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); }
[data-theme="light"] .pie-dot-bias { background: rgba(100,80,180,0.1); border-color: rgba(100,80,180,0.2); }
.pie-note { font-size: 0.7rem; color: var(--muted); margin-top: 0.5rem; opacity: 0.7; }
.fake-stats { display: flex; flex-direction: column; gap: 0.5rem; }
.fake-stat-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.88rem;
}
.fake-stat-pct {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple);
  flex-shrink: 0;
  min-width: 2.8rem;
}

/* ── Troll buttons row ── */
.troll-btns-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
  justify-content: center;
}
.troll-btn {
  padding: 0.55rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  transition: all 0.18s ease;
  background: transparent;
}
.troll-btn-share  { border-color: rgba(79,195,247,0.4); color: var(--cold); }
.troll-btn-share:hover  { background: rgba(79,195,247,0.08); transform: scale(1.03); }
.troll-btn-etmoi  { border-color: rgba(255,183,77,0.4); color: var(--warm); }
.troll-btn-etmoi:hover  { background: rgba(255,183,77,0.08); transform: scale(1.03); }
.troll-btn-recalc { border-color: rgba(239,83,80,0.4); color: var(--hot); }
.troll-btn-recalc:hover { background: rgba(239,83,80,0.08); transform: scale(1.03); }

/* ── Shame timer ── */
.shame-timer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--hot);
  margin-top: 0.75rem;
  font-style: italic;
  animation: pulse-shame 2s ease-in-out infinite;
}
@keyframes pulse-shame {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-text { color: var(--muted); line-height: 1.9; font-size: 0.95rem; margin-top: 0.75rem; }

/* ── Update badge ── */
.update-badge {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(79,195,247,0.25);
  background: rgba(79,195,247,0.06);
  color: var(--cold);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── Troll comment on custom sign ── */
.troll-comment {
  flex: 0 0 100%;
  margin-left: calc(1.6rem + 0.6rem);
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(196,77,255,0.3);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Action Plan (result page) ── */
.action-plan {
  margin-top: 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: left;
}
[data-theme="light"] .action-plan { background: rgba(100,80,180,0.04); }
.action-plan h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--purple);
}
body[data-mode="redflag"] .action-plan h3 { color: #ff6b6b; }
.action-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}
.action-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.action-step-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
body[data-mode="redflag"] .action-step-num {
  background: linear-gradient(135deg, #ff3b3b, #ff6b2b);
}

/* ── Mode Question Card ── */
#step-mode {
  background: linear-gradient(135deg,
    rgba(196,77,255,0.10) 0%,
    rgba(255,107,157,0.08) 50%,
    rgba(79,195,247,0.06) 100%);
  border-color: rgba(196,77,255,0.3);
  box-shadow:
    0 8px 32px rgba(196,77,255,0.18),
    0 2px 8px rgba(0,0,0,0.25);
  animation: mode-card-float 4s ease-in-out infinite;
}
@keyframes mode-card-float {
  0%, 100% { transform: translateY(0);    box-shadow: 0 8px 32px rgba(196,77,255,0.18), 0 2px 8px rgba(0,0,0,0.25); }
  50%       { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(196,77,255,0.28), 0 4px 12px rgba(0,0,0,0.2); }
}
[data-theme="light"] #step-mode {
  background: linear-gradient(135deg, rgba(196,77,255,0.07), rgba(255,107,157,0.05));
  border-color: rgba(196,77,255,0.25);
}

/* ── Mode Question Picker ── */
.mode-question-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.mode-question-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.1rem 0.75rem;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}
.mode-question-opt:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(196,77,255,0.15);
}
.mode-question-icon { font-size: 2rem; line-height: 1; }
.mode-question-title { font-size: 0.95rem; font-weight: 800; color: #fff; }
.mode-question-desc  { font-size: 0.72rem; color: rgba(255,255,255,0.65); line-height: 1.4; }
.mode-question-active {
  border-color: var(--purple) !important;
  background: rgba(196,77,255,0.18) !important;
  box-shadow: 0 0 24px rgba(196,77,255,0.35);
}
.mode-question-active .mode-question-title { color: var(--purple); }
[data-theme="light"] .mode-question-opt {
  border-color: rgba(100,80,180,0.2);
  background: rgba(100,80,180,0.06);
}
body[data-mode="redflag"] #step-mode {
  background: linear-gradient(135deg, rgba(255,59,59,0.1), rgba(255,107,59,0.07));
  border-color: rgba(255,59,59,0.3);
  animation: mode-card-float-red 4s ease-in-out infinite;
}
@keyframes mode-card-float-red {
  0%, 100% { transform: translateY(0);    box-shadow: 0 8px 32px rgba(255,59,59,0.18), 0 2px 8px rgba(0,0,0,0.25); }
  50%       { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(255,59,59,0.28), 0 4px 12px rgba(0,0,0,0.2); }
}
body[data-mode="redflag"] .mode-question-active {
  border-color: #ff4444 !important;
  background: rgba(255,68,68,0.18) !important;
  box-shadow: 0 0 24px rgba(255,68,68,0.35);
}
body[data-mode="redflag"] .mode-question-active .mode-question-title { color: #ff6b6b; }
body[data-mode="friendzone"] #step-mode {
  background: linear-gradient(135deg, rgba(74,104,128,0.12), rgba(45,74,99,0.08));
  border-color: rgba(74,104,128,0.3);
}
body[data-mode="friendzone"] .mode-question-active {
  border-color: #4a6880 !important;
  background: rgba(74,104,128,0.2) !important;
  box-shadow: 0 0 24px rgba(74,104,128,0.3);
}

/* ── Mode Toggle ── */
.mode-toggle {
  display: inline-flex;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 1.25rem;
  background: rgba(255,255,255,0.05);
  padding: 0.3rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.1);
}
[data-theme="light"] .mode-toggle {
  background: rgba(100,80,180,0.06);
  border-color: rgba(100,80,180,0.15);
}
.mode-btn {
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.mode-active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 2px 12px rgba(196,77,255,0.35);
}

/* ── Red Flag mode overrides ── */
body[data-mode="redflag"] {
  --pink:         #ff3b3b;
  --purple:       #ff6b2b;
  --sign-hover:   rgba(255,59,59,0.08);
  --sign-checked: rgba(255,59,59,0.15);
  background-image:
    radial-gradient(ellipse at 15% 60%, rgba(255,59,59,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(255,107,59,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 95%, rgba(255,59,59,0.07) 0%, transparent 50%);
}
body[data-mode="redflag"] .mode-btn.mode-active {
  background: linear-gradient(135deg, #ff3b3b, #ff6b2b);
  box-shadow: 0 2px 12px rgba(255,59,59,0.4);
}
body[data-mode="redflag"] .cert-badge {
  border-color: rgba(255,59,59,0.4);
  background: rgba(255,59,59,0.08);
  color: #ff6b6b;
}
body[data-mode="redflag"] .age-group-badge {
  background: rgba(255,59,59,0.1);
  border-color: rgba(255,59,59,0.3);
  color: #ff6b6b;
}
body[data-mode="redflag"] .age-slider {
  background: linear-gradient(90deg, #ff6b2b, #ff3b3b);
}
body[data-mode="redflag"] .age-slider::-webkit-slider-thumb {
  border-color: #ff3b3b;
  box-shadow: 0 2px 8px rgba(255,59,59,0.4);
}
body[data-mode="redflag"] .stamp {
  border-color: rgba(255,59,59,0.5);
  color: rgba(255,59,59,0.55);
}

/* ══════════════════════════════════════════════════════════
   FRIENDZONE MODE — dark, desaturated, depressive theme
   ══════════════════════════════════════════════════════════ */
body[data-mode="friendzone"] {
  --pink:         #7aaecb;
  --purple:       #5a8aaa;
  --bg:           #07090e;
  --card:         #0e1219;
  --card-bg:      #0e1219;
  --card-border:  rgba(120,160,195,0.11);
  --text:         #dde4ea;
  --text-muted:   #8aacbe;
  --muted:        #8aacbe;
  --sign-hover:   rgba(107,140,173,0.06);
  --sign-checked: rgba(107,140,173,0.12);
  --verdict-bg:   rgba(107,140,173,0.04);
  --verdict-border:rgba(107,140,173,0.1);
  --stat-bg:      rgba(107,140,173,0.04);
  --stat-border:  rgba(107,140,173,0.07);
  background-color: #080c12;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(20,35,55,0.7) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(15,25,45,0.6) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(10,18,30,0.5) 0%, transparent 55%);
}
body[data-mode="friendzone"] .mode-btn.mode-active {
  background: linear-gradient(135deg, #2d4a63, #3d5a78);
  box-shadow: 0 2px 12px rgba(45,74,99,0.5);
  color: #8ab4d4;
}
body[data-mode="friendzone"] .cert-badge {
  border-color: rgba(120,170,210,0.3);
  background: rgba(120,170,210,0.08);
  color: #8aacbe;
}
body[data-mode="friendzone"] .age-group-badge {
  background: rgba(120,170,210,0.1);
  border-color: rgba(120,170,210,0.25);
  color: #8aacbe;
}
body[data-mode="friendzone"] .age-slider {
  background: linear-gradient(90deg, #2d4a63, #4a6880);
}
body[data-mode="friendzone"] .age-slider::-webkit-slider-thumb {
  border-color: #4a6880;
  box-shadow: 0 2px 8px rgba(74,104,128,0.35);
}
body[data-mode="friendzone"] .stamp {
  border-color: rgba(107,140,173,0.3);
  color: rgba(107,140,173,0.4);
}
body[data-mode="friendzone"] .highlight {
  background: linear-gradient(135deg, #6b8cad, #4a6880);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body[data-mode="friendzone"] .card {
  background: var(--card);
  border-color: var(--card-border);
}
body[data-mode="friendzone"] .btn-step-next,
body[data-mode="friendzone"] .btn-submit {
  background: linear-gradient(135deg, #2d4a63, #3d5a78);
  box-shadow: 0 4px 16px rgba(45,74,99,0.4);
}
body[data-mode="friendzone"] .btn-yes {
  background: linear-gradient(135deg, #2d4a63, #4a6880);
  box-shadow: 0 4px 16px rgba(45,74,99,0.3);
}
body[data-mode="friendzone"] .btn-yes:hover {
  box-shadow: 0 6px 22px rgba(74,104,128,0.45);
}
body[data-mode="friendzone"] .action-plan h3 { color: #8aacbe; }
body[data-mode="friendzone"] .action-step-num {
  background: linear-gradient(135deg, #2d4a63, #4a6880);
}
body[data-mode="friendzone"] .situation-opt.situation-opt-active {
  background: rgba(107,140,173,0.12);
  border-color: rgba(107,140,173,0.4);
  color: #8ab4d4;
}
body[data-mode="friendzone"] .groq-badge {
  background: linear-gradient(135deg, rgba(45,74,99,0.3), rgba(74,104,128,0.2));
  border-color: rgba(74,104,128,0.35);
}
body[data-mode="friendzone"] .sign-ai-result {
  background: rgba(45,74,99,0.12);
  border-color: rgba(74,104,128,0.2);
  border-left-color: rgba(107,140,173,0.5);
}
body[data-mode="friendzone"] .float-cta {
  background: linear-gradient(135deg, #2d4a63, #3d5a78);
  box-shadow: 0 6px 24px rgba(45,74,99,0.5);
}
body[data-mode="friendzone"] .situation-recal {
  background: rgba(120,170,210,0.08);
  border-color: rgba(120,170,210,0.2);
  color: #8aacbe;
}

/* ── Friendzone blobs: slow, dark, melancholic ── */
body[data-mode="friendzone"] .blob-1 {
  background: #0d1f35;
  animation-duration: 45s;
  opacity: 0.5;
  filter: blur(130px);
}
body[data-mode="friendzone"] .blob-2 {
  background: #091525;
  animation-duration: 50s;
  opacity: 0.45;
  filter: blur(140px);
}
body[data-mode="friendzone"] .blob-3 {
  background: #0a1828;
  animation-duration: 55s;
  opacity: 0.4;
  filter: blur(150px);
}
body[data-mode="friendzone"] .blob-4 {
  background: #071020;
  animation-duration: 60s;
  opacity: 0.3;
  filter: blur(160px);
}

/* ══════════════════════════════════════════════════════════
   MOOD-BASED BACKGROUNDS (result page)
   ══════════════════════════════════════════════════════════ */

/* JOY — attraction ≥ 70% : euphoric pink/gold/warm */
body[data-mood="joy"] {
  background-color: #1a0d2e;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(255,180,50,0.18)  0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(255,107,157,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(196,77,255,0.10)  0%, transparent 60%);
}
body[data-mood="joy"] .blob-1 { background: #ff9f43; animation-duration: 22s; opacity: 0.55; filter: blur(100px); }
body[data-mood="joy"] .blob-2 { background: #ff6b9d; animation-duration: 26s; opacity: 0.5;  filter: blur(110px); }
body[data-mood="joy"] .blob-3 { background: #ffca74; animation-duration: 30s; opacity: 0.4;  filter: blur(120px); }
body[data-mood="joy"] .blob-4 { background: #ff4f9a; animation-duration: 18s; opacity: 0.45; filter: blur(90px);  }

/* HOPE — attraction 40-69% : soft purple/blue, cautiously romantic */
body[data-mood="hope"] {
  background-color: #12102a;
  background-image:
    radial-gradient(ellipse at 25% 30%, rgba(150,100,255,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 70%, rgba(100,180,255,0.12) 0%, transparent 55%);
}
body[data-mood="hope"] .blob-1 { background: #8b5cf6; animation-duration: 35s; opacity: 0.45; filter: blur(120px); }
body[data-mood="hope"] .blob-2 { background: #6ee7f7; animation-duration: 40s; opacity: 0.35; filter: blur(130px); }
body[data-mood="hope"] .blob-3 { background: #a78bfa; animation-duration: 45s; opacity: 0.3;  filter: blur(140px); }
body[data-mood="hope"] .blob-4 { background: #38bdf8; animation-duration: 38s; opacity: 0.25; filter: blur(120px); }

/* DOOM — attraction < 40% or friendzone low : cold, dark, existential */
body[data-mood="doom"] {
  background-color: #080c12;
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(30,50,90,0.4)  0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(20,30,60,0.35) 0%, transparent 60%);
}
body[data-mood="doom"] .blob-1 { background: #1e2a4a; animation-duration: 55s; opacity: 0.5;  filter: blur(140px); }
body[data-mood="doom"] .blob-2 { background: #0f1a30; animation-duration: 60s; opacity: 0.45; filter: blur(150px); }
body[data-mood="doom"] .blob-3 { background: #162035; animation-duration: 65s; opacity: 0.35; filter: blur(160px); }
body[data-mood="doom"] .blob-4 { background: #0a1020; animation-duration: 70s; opacity: 0.3;  filter: blur(170px); }

/* SHAME — friendzone high : awkward mauve/lilac, that cringe feeling */
body[data-mood="shame"] {
  background-color: #100d1a;
  background-image:
    radial-gradient(ellipse at 40% 30%, rgba(120,80,160,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 70%, rgba(80,60,120,0.14)  0%, transparent 55%);
}
body[data-mood="shame"] .blob-1 { background: #7c4fa0; animation-duration: 48s; opacity: 0.4;  filter: blur(130px); }
body[data-mood="shame"] .blob-2 { background: #4a3270; animation-duration: 52s; opacity: 0.35; filter: blur(140px); }
body[data-mood="shame"] .blob-3 { background: #6b4590; animation-duration: 56s; opacity: 0.3;  filter: blur(150px); }
body[data-mood="shame"] .blob-4 { background: #3a2558; animation-duration: 60s; opacity: 0.25; filter: blur(160px); }

/* DANGER — red flag high : burning red/orange, alarm */
body[data-mood="danger"] {
  background-color: #150505;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255,59,59,0.2)  0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(255,107,0,0.15) 0%, transparent 55%);
}
body[data-mood="danger"] .blob-1 { background: #ff2d2d; animation-duration: 20s; opacity: 0.5;  filter: blur(110px); }
body[data-mood="danger"] .blob-2 { background: #ff6b00; animation-duration: 24s; opacity: 0.45; filter: blur(120px); }
body[data-mood="danger"] .blob-3 { background: #cc1010; animation-duration: 28s; opacity: 0.4;  filter: blur(130px); }
body[data-mood="danger"] .blob-4 { background: #ff4500; animation-duration: 22s; opacity: 0.35; filter: blur(100px); }

/* SUSPICIOUS — red flag low : dark amber/grey, uneasy */
body[data-mood="suspicious"] {
  background-color: #0f0d08;
  background-image:
    radial-gradient(ellipse at 35% 45%, rgba(180,120,30,0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 65% 55%, rgba(120,80,20,0.12)  0%, transparent 55%);
}
body[data-mood="suspicious"] .blob-1 { background: #b87c20; animation-duration: 42s; opacity: 0.4;  filter: blur(130px); }
body[data-mood="suspicious"] .blob-2 { background: #7a5010; animation-duration: 46s; opacity: 0.35; filter: blur(140px); }
body[data-mood="suspicious"] .blob-3 { background: #a06818; animation-duration: 50s; opacity: 0.3;  filter: blur(150px); }
body[data-mood="suspicious"] .blob-4 { background: #604010; animation-duration: 54s; opacity: 0.25; filter: blur(160px); }

/* ── Footer ── */
footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════
   AI SIGN ANALYSIS (Groq)
   ═══════════════════════════════════════════════════════════ */
.sign-ai-comment {
  flex: 0 0 100%;
  /* indent to align under the input, skipping num badge + gap */
  margin-left: calc(1.6rem + 0.6rem);
  margin-top: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.groq-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(106,13,173,0.25), rgba(196,69,105,0.2));
  border: 1px solid rgba(106,13,173,0.35);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.8rem;
  animation: groq-glow 3s ease-in-out infinite;
}
@keyframes groq-glow {
  0%,100% { box-shadow: 0 0 6px rgba(106,13,173,0.2); }
  50%      { box-shadow: 0 0 14px rgba(196,69,105,0.35); }
}
[data-theme="light"] .groq-badge { background: rgba(106,13,173,0.08); border-color: rgba(106,13,173,0.2); }
body[data-mode="redflag"] .groq-badge {
  background: linear-gradient(135deg, rgba(255,68,68,0.2), rgba(180,0,0,0.15));
  border-color: rgba(255,68,68,0.35);
}

.sign-ai-loading {
  color: var(--muted);
  font-style: italic;
  background: rgba(255,255,255,0.04);
  animation: ai-pulse 1.1s ease-in-out infinite;
}
@keyframes ai-pulse {
  0%,100% { opacity: 0.45; }
  50%      { opacity: 1;    }
}
.sign-ai-result {
  background: rgba(106,13,173,0.09);
  border: 1px solid rgba(106,13,173,0.22);
  border-left: 3px solid rgba(196,77,255,0.55);
  color: var(--text);
  align-items: flex-start;
  padding: 0.6rem 0.85rem;
}
.sign-ai-result .ai-text {
  flex-basis: 100%;
  font-style: italic;
  opacity: 0.9;
  line-height: 1.6;
  margin-top: 0.1rem;
}
body[data-mode="redflag"] .sign-ai-result {
  background: rgba(255,68,68,0.08);
  border-color: rgba(255,68,68,0.22);
  border-left-color: rgba(255,68,68,0.6);
}
.ai-badge {
  background: rgba(106,13,173,0.35);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-weight {
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-weight.w3 { color: #ff6b9d; }
.ai-weight.w2 { color: #f0a500; }
.ai-weight.w1 { color: var(--muted); }
.ai-text { flex: 1; min-width: 0; }
[data-theme="light"] .sign-ai-result {
  background: rgba(106,13,173,0.06);
  border-color: rgba(106,13,173,0.18);
  border-left-color: rgba(196,77,255,0.45);
}
[data-theme="light"] .ai-badge { background: rgba(106,13,173,0.15); }

/* ═══════════════════════════════════════════════════════════
   PROGRESS WIZARD
   ═══════════════════════════════════════════════════════════ */
.progress-wizard {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin: 1.5rem 0 1.8rem;
  padding: 0 0.5rem;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 64px;
}
.wizard-num {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  background: transparent;
}
.wizard-label {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.35s;
  white-space: nowrap;
}
.wizard-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 0.3rem;
  margin-top: 1.15rem;
  transition: background 0.5s;
  max-width: 90px;
  min-width: 20px;
}
.wizard-step.wizard-step-active .wizard-num {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
  box-shadow: 0 0 18px rgba(196,69,105,0.45);
  transform: scale(1.1);
}
.wizard-step.wizard-step-active .wizard-label { color: var(--pink); }
.wizard-step.wizard-step-done .wizard-num {
  border-color: #4caf7d;
  background: #4caf7d;
  color: #fff;
  font-size: 0;
}
.wizard-step.wizard-step-done .wizard-num::after {
  content: '✓';
  font-size: 1rem;
  font-weight: 900;
}
.wizard-step.wizard-step-done .wizard-label { color: #4caf7d; }
.wizard-line.wizard-line-done { background: #4caf7d; }
[data-theme="light"] .wizard-line { background: rgba(0,0,0,0.1); }

/* ═══════════════════════════════════════════════════════════
   SITUATION PICKER
   ═══════════════════════════════════════════════════════════ */
.situation-section {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.situation-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.situation-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.situation-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.situation-opt:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
}
.situation-opt-active {
  border-color: var(--purple) !important;
  background: rgba(106,13,173,0.15) !important;
  box-shadow: 0 0 12px rgba(106,13,173,0.25);
}
.sit-icon { font-size: 1.5rem; line-height: 1; }
.sit-text  { font-size: 0.78rem; font-weight: 600; text-align: center; }
[data-theme="light"] .situation-opt { border-color: rgba(100,80,180,0.2); background: rgba(100,80,180,0.04); }
body[data-mode="redflag"] .situation-opt-active {
  border-color: #ff4444 !important;
  background: rgba(255,68,68,0.12) !important;
  box-shadow: 0 0 12px rgba(255,68,68,0.25);
}

/* ── Step 1 next button ── */
.step-next-row {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.btn-step-next {
  width: 100%;
  padding: 0.95rem 1.5rem;
  border-radius: 16px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: not-allowed;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}
.btn-step-next.btn-step-next-ready {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(196,69,105,0.35);
}
.btn-step-next.btn-step-next-ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(196,69,105,0.5);
}
body[data-mode="redflag"] .btn-step-next.btn-step-next-ready {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  box-shadow: 0 4px 20px rgba(255,68,68,0.35);
}
.step-next-hint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* ── Signs loading animation ── */
.signs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem;
  margin-top: 0.5rem;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  animation: signs-loading-fadein 0.3s ease;
}
@keyframes signs-loading-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.signs-loading-emoji {
  font-size: 2.4rem;
  animation: signs-loading-pulse 1.4s ease-in-out infinite;
}
@keyframes signs-loading-pulse {
  0%,100% { transform: scale(1) rotate(-6deg); }
  50%     { transform: scale(1.2) rotate(6deg); }
}
.signs-loading-text {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  animation: signs-loading-shimmer 2.2s ease-in-out infinite;
}
@keyframes signs-loading-shimmer {
  0%,100% { opacity: 0.6; }
  50%     { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   RESULT PAGE — situation + audio
   ═══════════════════════════════════════════════════════════ */
.result-badges-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem auto 0;
}
.situation-result-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
body[data-mode="redflag"] .situation-result-badge {
  border-color: rgba(255,68,68,0.3);
  background: rgba(255,68,68,0.08);
}
.situation-context-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0.5rem auto 0;
  max-width: 480px;
  line-height: 1.5;
  font-style: italic;
}

/* Audio button */
.audio-row {
  display: flex;
  justify-content: center;
  margin: 0.8rem 0 0.2rem;
}
.btn-audio {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-audio:hover {
  border-color: var(--pink);
  background: rgba(196,69,105,0.1);
  transform: scale(1.04);
}
[data-theme="light"] .situation-result-badge { background: rgba(100,80,180,0.08); border-color: rgba(100,80,180,0.2); }
[data-theme="light"] .btn-audio { border-color: rgba(100,80,180,0.25); }

/* ═══════════════════════════════════════════════════════════
   ANIMATED MOOD BACKGROUND — blobs + particles
   Cycle 20s: 0-6s love (rose/pink) → 11-16s depression (dark navy/indigo) → repeat
   ═══════════════════════════════════════════════════════════ */

/* ── Blob container ── */
#bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.38;
  pointer-events: none;
  will-change: transform, background-color;
}

/* Blob 1 – large, top-left. Rose → dark indigo */
.blob-1 {
  width: 700px; height: 700px;
  left: -180px; top: -100px;
  background: #c44569;
  animation: blob1-drift 20s ease-in-out infinite;
}
@keyframes blob1-drift {
  0%,100% { background:#c44569; transform: translate(0,   0)   scale(1);   }
  30%      { background:#e8399a; transform: translate(180px,120px) scale(1.15); }
  60%      { background:#1a1a3d; transform: translate(60px, 300px) scale(0.85); }
  80%      { background:#0a1232; transform: translate(-40px,250px) scale(0.9);  }
}

/* Blob 2 – large, bottom-right. Pink → navy */
.blob-2 {
  width: 600px; height: 600px;
  right: -150px; bottom: -80px;
  background: #ff6b9d;
  animation: blob2-drift 20s ease-in-out infinite;
  animation-delay: -8s;
}
@keyframes blob2-drift {
  0%,100% { background:#ff6b9d; transform: translate(0,    0)    scale(1);   }
  30%      { background:#c44569; transform: translate(-120px,-80px) scale(1.1); }
  60%      { background:#0a1628; transform: translate(60px, -200px) scale(1.3); }
  80%      { background:#161635; transform: translate(-30px,-150px) scale(1.15);}
}

/* Blob 3 – medium, center-bottom. Magenta → deep purple */
.blob-3 {
  width: 450px; height: 450px;
  left: 35%; bottom: -80px;
  background: #e8399a;
  animation: blob3-drift 20s ease-in-out infinite;
  animation-delay: -14s;
}
@keyframes blob3-drift {
  0%,100% { background:#e8399a; transform: translate(0,    0)    scale(1);   }
  35%      { background:#ff4d6d; transform: translate(-80px,-60px) scale(0.9); }
  65%      { background:#2c2c54; transform: translate(130px,50px)  scale(1.2); }
  80%      { background:#1a1040; transform: translate(80px,  20px) scale(1.1); }
}

/* Blob 4 – small accent, top-right. Soft pink → dark slate */
.blob-4 {
  width: 320px; height: 320px;
  right: 10%; top: -50px;
  background: #ff8fab;
  opacity: 0.28;
  animation: blob4-drift 20s ease-in-out infinite;
  animation-delay: -4s;
}
@keyframes blob4-drift {
  0%,100% { background:#ff8fab; transform: translate(0,0)     scale(1);  opacity:0.28; }
  30%      { background:#c44569; transform: translate(-60px,80px) scale(1.3); opacity:0.4; }
  60%      { background:#161640; transform: translate(40px,140px) scale(0.7); opacity:0.5; }
  80%      { background:#0a0a2a; transform: translate(-20px,100px) scale(0.8); opacity:0.45; }
}

/* Light theme: blobs subtler */
[data-theme="light"] .blob {
  opacity: 0.18;
  filter: blur(130px);
}

/* ── Particles container ── */
#particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-particle {
  position: absolute;
  font-size: 1.4rem;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}
.particle-up {
  animation-name: particle-rise;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
.particle-down {
  animation-name: particle-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes particle-rise {
  0%   { transform: translateX(0) translateY(0) rotate(0deg) scale(1); opacity: 0.7; }
  100% { transform: translateX(var(--drift, 0px)) translateY(-110vh) rotate(360deg) scale(0.5); opacity: 0; }
}
@keyframes particle-fall {
  0%   { transform: translateX(0) translateY(0) rotate(0deg) scale(1); opacity: 0.7; }
  100% { transform: translateX(var(--drift, 0px)) translateY(110vh) rotate(-360deg) scale(0.5); opacity: 0; }
}

/* ════════════════════════════════════════════════════════
   UX IMPROVEMENTS
   ════════════════════════════════════════════════════════ */

/* ── Back button ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 0.75rem;
  transition: color 0.18s;
  font-family: inherit;
}
.btn-back:hover { color: var(--text); }

/* ── Floating CTA ── */
.float-cta {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(196,77,255,0.45);
  animation: float-pulse 2s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.float-cta:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 32px rgba(196,77,255,0.6);
}
@keyframes float-pulse {
  0%,100% { box-shadow: 0 6px 24px rgba(196,77,255,0.45); }
  50%      { box-shadow: 0 6px 32px rgba(255,107,157,0.6); }
}
body[data-mode="redflag"] .float-cta {
  background: linear-gradient(135deg, #ff3b3b, #ff6b2b);
  box-shadow: 0 6px 24px rgba(255,59,59,0.45);
}
.float-cta button {
  background: transparent;
  border: none;
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}

/* ── Live yes/no score bar ── */
.live-score-bar {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.4s;
}
.live-score-bar.visible { opacity: 1; }
.live-score-yes { color: var(--pink); }
.live-score-no  { color: var(--muted); }

/* ── Groq loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Loader card ── */
.loader-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(196,77,255,0.15);
  animation: loader-card-in 0.35s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes loader-card-in {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);        opacity: 1; }
}

/* ── Floating hearts row ── */
.loader-hearts {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  height: 56px;
  align-items: flex-end;
}
.lh {
  font-size: 2.2rem;
  display: inline-block;
  animation: lh-bounce 1.6s ease-in-out infinite;
}
.lh1 { animation-delay: 0s; }
.lh2 { animation-delay: 0.22s; }
.lh3 { animation-delay: 0.44s; }
@keyframes lh-bounce {
  0%,100% { transform: translateY(0)    scale(1);    }
  40%     { transform: translateY(-18px) scale(1.18); }
  60%     { transform: translateY(-10px) scale(1.08); }
}

/* ── Progress bar ── */
.loader-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--cold));
  background-size: 200% 100%;
  animation: bar-shimmer 1.5s linear infinite;
  transition: width 0.6s cubic-bezier(0.25,1,0.5,1);
}
@keyframes bar-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.loading-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.2px;
}
.loading-sub {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
  min-height: 2.8em;
}
.loading-dots {
  display: flex;
  gap: 6px;
}
.loading-dots span {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pink);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.18s; background: var(--purple); }
.loading-dots span:nth-child(3) { animation-delay: 0.36s; background: var(--cold); }
@keyframes dot-bounce {
  0%,80%,100% { transform: translateY(0); opacity: 0.35; }
  40%          { transform: translateY(-8px); opacity: 1; }
}

/* ── Result jump-bar ── */
.jump-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.jump-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  font-family: inherit;
}
.jump-btn:hover { border-color: var(--pink); color: var(--text); }
[data-theme="light"] .jump-btn { border-color: rgba(100,80,180,0.18); background: rgba(100,80,180,0.04); }

/* ── Ring intensity label ── */
.ring-intensity {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
  opacity: 0.85;
}

/* ── Confidence label ── */
.confidence-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
[data-theme="light"] .confidence-label { border-color: rgba(100,80,180,0.15); background: rgba(100,80,180,0.04); }
.confidence-low  { color: var(--warm); border-color: rgba(255,183,77,0.3); background: rgba(255,183,77,0.06); }
.confidence-high { color: #4caf7d;    border-color: rgba(76,175,125,0.3); background: rgba(76,175,125,0.06); }

/* ── Weight tooltip ── */
.weight-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.weight-tip-icon {
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  margin-left: 0.4rem;
  flex-shrink: 0;
}
[data-theme="light"] .weight-tip-icon { border-color: rgba(100,80,180,0.2); }
.weight-tip-icon:hover + .weight-tip-box,
.weight-tip-box:hover { display: block; }
.weight-tip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  line-height: 1.7;
  pointer-events: none;
}
.weight-tip-box::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--card);
}

/* ── Situation recalibration notice ── */
.situation-recal {
  display: none;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(196,77,255,0.08);
  border: 1px solid rgba(196,77,255,0.2);
  font-size: 0.75rem;
  color: var(--purple);
  animation: fadeIn 0.3s ease;
}
body[data-mode="redflag"] .situation-recal { background: rgba(255,59,59,0.08); border-color: rgba(255,59,59,0.2); color: #ff6b6b; }

/* ── Focus rings (accessibility) ── */
.gender-option:focus-visible,
.situation-opt:focus-visible,
.btn-step-next:focus-visible,
.btn-submit:focus-visible,
.btn-yes:focus-visible,
.btn-no:focus-visible,
.jump-btn:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════════════════════ */

/* ── Tablet / wide phone (≤ 768px) ── */
@media (max-width: 768px) {
  .container { padding: 1.5rem 1rem 3.5rem; }
  h1 { font-size: 2rem; }
  .card { padding: 1.5rem; }
  .stats-row { gap: 0.5rem; }
}

/* ── Mobile (≤ 600px) ── */
@media (max-width: 600px) {
  /* Base */
  .container { padding: 1.25rem 0.85rem 3rem; }
  h1 { font-size: 1.7rem; letter-spacing: -0.2px; }
  .card { padding: 1.25rem 1rem; border-radius: 16px; }

  /* Lang/theme bar — keep everything right-aligned on mobile */
  .lang-bar { padding: 0.75rem 0 0; gap: 0.5rem; }
  .lang-group { gap: 0.3rem; }

  /* Mode toggle — wrap buttons on very small widths */
  .mode-toggle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    padding: 0.25rem;
    width: 100%;
  }
  .mode-btn { font-size: 0.82rem; padding: 0.45rem 0.9rem; flex: 1 1 auto; text-align: center; }

  /* Wizard progress */
  .progress-wizard { margin: 1rem 0 1.4rem; }
  .wizard-step { min-width: 48px; }
  .wizard-label { font-size: 0.6rem; letter-spacing: 0.03em; }
  .wizard-line { max-width: 48px; min-width: 10px; }

  /* Mode question picker */
  .mode-question-picker { grid-template-columns: 1fr; gap: 0.5rem; }
  .mode-question-opt { flex-direction: row; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; text-align: left; }
  .mode-question-icon { font-size: 1.6rem; flex-shrink: 0; }
  .mode-question-desc { display: none; }

  /* Gender picker */
  .gender-option { padding: 1.1rem 0.5rem; }
  .gender-icon   { font-size: 2rem; }
  .gender-text   { font-size: 0.9rem; }

  /* Situation picker already 2-col — keep it, but tighten padding */
  .situation-opt { padding: 0.65rem 0.35rem; }
  .sit-icon { font-size: 1.3rem; }
  .sit-text  { font-size: 0.72rem; }

  /* Tone & custom inputs */
  .tone-select, .situation-custom-input { font-size: 0.88rem; padding: 0.55rem 0.85rem; }
  .tone-select { background-position: right 0.75rem center; }

  /* Carousel */
  .carousel-actions { gap: 0.5rem; }
  .btn-no, .btn-yes { padding: 0.9rem 0.5rem; font-size: 0.92rem; max-width: none; }

  /* Percentage ring */
  .percentage-ring { width: 136px; height: 136px; }
  .percentage-num  { font-size: 2.4rem; }

  /* Stats row — keep 3 columns but tighten on mobile */
  .stats-row { gap: 0.4rem; }
  .stat-box  { padding: 0.75rem 0.35rem; border-radius: 10px; }
  .stat-num  { font-size: 1.3rem; }

  /* Stamp — keep it but shrink & adjust position so it never overflows */
  .stamp {
    width: 64px; height: 64px;
    top: 1rem; right: 1rem;
    font-size: 0.55rem;
    border-width: 3px;
  }


  /* Custom breakdown */
  .custom-breakdown { padding: 1rem 1rem; }

  /* Diagnosis label */
  .diagnosis-label { font-size: 0.82rem; padding: 0.4rem 0.9rem; }

  /* Jump bar */
  .jump-bar { gap: 0.35rem; }
  .jump-btn  { font-size: 0.7rem; padding: 0.3rem 0.65rem; }

  /* Troll buttons */
  .troll-btns-row { gap: 0.4rem; margin-top: 1.25rem; }
  .troll-btn      { font-size: 0.78rem; padding: 0.6rem 0.85rem; min-height: 44px; }

  /* Share card */
  .btn-share-card { font-size: 0.92rem; padding: 0.7rem 1.4rem; }

  /* Floating CTA */
  .float-cta { bottom: 1rem; right: 1rem; font-size: 0.85rem; padding: 0.75rem 1.2rem; }

  /* Situation recalibration */
  .situation-recal { font-size: 0.72rem; }

  /* Custom sign AI response — no indent on mobile, just full width below */
  .sign-ai-comment,
  .troll-comment { margin-left: 0; }
}

/* ── Small phones (≤ 400px) ── */
@media (max-width: 400px) {
  .container { padding: 1rem 0.65rem 3rem; }
  h1 { font-size: 1.45rem; }
  .card { padding: 1rem 0.85rem; border-radius: 14px; }

  .mode-btn  { font-size: 0.76rem; padding: 0.4rem 0.7rem; }
  .wizard-label { display: none; }   /* labels hidden on tiny screens to prevent overlap */

  .percentage-ring { width: 120px; height: 120px; }
  .percentage-num  { font-size: 2.1rem; }

  .troll-btn { font-size: 0.72rem; padding: 0.55rem 0.65rem; }
  .btn-share-card { font-size: 0.84rem; padding: 0.65rem 1.1rem; }

  .stamp { width: 52px; height: 52px; top: 0.75rem; right: 0.75rem; font-size: 0.5rem; }
}

/* ── Confetti (easter egg) ── */
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  top: -10px;
  pointer-events: none;
  z-index: 999;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ── Diagnosis label ── */
.diagnosis-label {
  display: inline-block;
  background: linear-gradient(135deg, rgba(106,13,173,0.15), rgba(196,69,105,0.12));
  border: 1px solid rgba(196,69,105,0.3);
  border-radius: 20px;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  color: #d68fff;
  margin: 0.5rem auto 0.9rem;
  text-align: center;
  letter-spacing: 0.01em;
}
[data-theme="light"] .diagnosis-label {
  background: rgba(106,13,173,0.07);
  border-color: rgba(106,13,173,0.2);
  color: #6a0dad;
}
body[data-mode="redflag"] .diagnosis-label {
  background: linear-gradient(135deg, rgba(255,59,59,0.15), rgba(180,0,0,0.1));
  border-color: rgba(255,59,59,0.3);
  color: #ff9999;
}
body[data-mode="friendzone"] .diagnosis-label {
  background: linear-gradient(135deg, rgba(74,104,128,0.2), rgba(45,74,99,0.15));
  border-color: rgba(74,104,128,0.35);
  color: #8ab4d4;
}

/* ── Evidence row (red/green flag signs) ── */
.evidence-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
}
.evidence-card {
  width: 100%;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid transparent;
}
.evidence-red {
  background: linear-gradient(135deg, rgba(255,59,59,0.12), rgba(180,0,0,0.08));
  border-color: rgba(255,59,59,0.25);
}
.evidence-green {
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(16,130,56,0.08));
  border-color: rgba(34,197,94,0.25);
}
.evidence-icon {
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
}
.evidence-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  text-align: center;
}
.evidence-text {
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.9;
  text-align: center;
}
[data-theme="light"] .evidence-red {
  background: rgba(255,59,59,0.06);
  border-color: rgba(255,59,59,0.2);
}
[data-theme="light"] .evidence-green {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.2);
}

/* ── Situation custom input ── */
.situation-custom-wrap {
  margin-top: 0.65rem;
  animation: fadeIn 0.2s ease;
}
.situation-custom-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  color: inherit;
  font-size: 0.93rem;
  padding: 0.6rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.situation-custom-input:focus {
  border-color: rgba(196,69,105,0.55);
  box-shadow: 0 0 0 3px rgba(196,69,105,0.12);
}
.situation-custom-input::placeholder { opacity: 0.45; }
[data-theme="light"] .situation-custom-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.15);
  color: #222;
}

/* ── Tone select ── */
.tone-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  color: inherit;
  font-size: 0.93rem;
  padding: 0.6rem 1rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tone-select:focus {
  border-color: rgba(196,69,105,0.55);
  box-shadow: 0 0 0 3px rgba(196,69,105,0.12);
}
.tone-select option {
  background: #1a1a2e;
  color: #eee;
}
[data-theme="light"] .tone-select {
  background-color: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.15);
  color: #222;
}
[data-theme="light"] .tone-select option {
  background: #fff;
  color: #222;
}

/* ── Custom situation input error state ── */
.situation-custom-input.input-error {
  border-color: rgba(255, 59, 59, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.2);
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* ── Result GIF ── */
.result-gif-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}
.result-gif {
  border-radius: 16px;
  max-width: 280px;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ── Shareable card ── */
.share-card-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 1rem;
}
.btn-share-card {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(196,77,255,0.35);
}
.btn-share-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(196,77,255,0.5); }
.btn-share-card:disabled { opacity: 0.6; cursor: default; transform: none; }
.card-actions-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
