:root {
  --kd-teal: #2dd4bf;
  --kd-teal-deep: #0d9488;
  --kd-orange: #ff9f43;
  --kd-orange-deep: #f7791e;
  --kd-tint: #e6fbf7;

  --bg: #0e1416;
  --panel: #182226;
  --panel2: #202d31;
  --text: #eef7f5;
  --muted: #93aaa8;
  --border: #2b3a3d;
  --error: #ff6b6b;
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle, rgba(255, 107, 157, 0.10) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow-x: hidden;
}

body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  opacity: .35;
}
body::before { width: 440px; height: 440px; background: var(--kd-teal); top: -140px; left: -160px; }
body::after { width: 400px; height: 400px; background: var(--kd-orange); bottom: -120px; right: -160px; }

.topbar {
  background: linear-gradient(135deg, var(--kd-teal), var(--kd-orange));
  color: #fff;
  padding: 22px 20px;
  text-align: center;
}
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.topbar .brand-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  animation: pop-in .5s var(--ease);
}
.topbar .tagline { margin: 6px 0 0; font-size: 14px; color: #fbe4ee; }

.wrap { max-width: 640px; margin: 0 auto; padding: 28px 20px 80px; }

.screen { animation: fade-up .4s var(--ease); }
.screen.hidden { display: none; }
.hidden { display: none !important; }

h1 { font-size: clamp(24px, 6vw, 32px); text-align: center; margin: 6px 0 10px; }
h2 { font-size: 21px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 14px; color: var(--kd-teal); display: flex; align-items: center; gap: 6px; }

.hero-emoji { font-size: 52px; text-align: center; margin-bottom: 4px; }
.hero-emoji.pulse { animation: pulse-scale 1.6s ease-in-out infinite; }
.hero-sub { color: var(--muted); text-align: center; margin: 0 0 22px; font-size: 15px; line-height: 1.5; }

/* ---------- Form alanlari ---------- */

.field-block { margin-bottom: 18px; }
.field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }

.text-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.text-input:focus { border-color: var(--kd-teal); }

.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.rel-chip:hover { border-color: var(--kd-teal); }
.rel-chip.active {
  background: linear-gradient(135deg, var(--kd-teal), var(--kd-orange));
  border-color: transparent;
  color: #fff;
}

.privacy-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0;
}

.counter-line { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.counter-line #counterValue { font-weight: 700; color: var(--kd-teal); }

.error { color: var(--error); font-size: 14px; min-height: 18px; text-align: center; }

/* ---------- Butonlar ---------- */

.primaryBtn {
  background: linear-gradient(135deg, var(--kd-teal), var(--kd-orange));
  color: white;
  border: none;
  padding: 15px 20px;
  min-height: 50px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: block;
  width: 100%;
  box-shadow: 0 4px 18px rgba(255, 107, 157, .35);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), opacity .12s;
}
.primaryBtn:hover { box-shadow: 0 6px 22px rgba(255, 107, 157, .45); }
.primaryBtn:active { transform: scale(.97); opacity: .92; }
.primaryBtn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.secondaryBtn {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s;
}
.secondaryBtn:hover { border-color: var(--kd-teal); }

.linkBtn { background: none; border: none; color: var(--kd-teal); cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px; }

/* ---------- Soru akisi ---------- */

.progress-wrap { margin-bottom: 24px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--kd-teal), var(--kd-orange));
  border-radius: 999px;
  transition: width .35s var(--ease);
}
.progress-text { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; font-weight: 600; }

.question-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 22px;
  text-align: center;
  animation: fade-up .3s var(--ease);
}

.question-stage {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--kd-orange);
  background: rgba(124, 92, 255, .15);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.question-category { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.question-text { font-size: 22px; margin: 0 0 26px; line-height: 1.35; }

.answer-buttons { display: flex; flex-direction: column; gap: 12px; }
.answerBtn {
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s var(--ease), border-color .12s var(--ease), background .12s var(--ease);
}
.answerBtn:hover { border-color: var(--kd-teal); }
.answerBtn:active { transform: scale(.97); }

/* ---------- Bekleme ekrani ---------- */

.share-link-box { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link-box .text-input { flex: 1; font-size: 14px; }

.waiting-indicator {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 32px; color: var(--muted); font-size: 14px;
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--kd-tint);
  border-top-color: var(--kd-teal);
  animation: spin .7s linear infinite;
}

/* ---------- Sonuc ekrani ---------- */

.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 20px; }

.stat-card {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-left: 4px solid var(--kd-teal);
  border-radius: 14px;
  padding: 16px;
  animation: fade-up .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.stat-card .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; font-weight: 600; }
.stat-card .value { font-size: 19px; font-weight: 700; }
.stat-card.wide { grid-column: 1 / -1; }

.card-section, .ai-section {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}

.category-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.category-row .cat-label { flex: none; width: 130px; font-size: 13.5px; font-weight: 600; }
.category-row .cat-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.category-row .cat-fill { height: 100%; background: linear-gradient(90deg, var(--kd-teal), var(--kd-orange)); border-radius: 999px; }
.category-row .cat-pct { flex: none; width: 42px; text-align: right; font-size: 13.5px; font-weight: 700; }

.divergent-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.divergent-item:last-child { border-bottom: none; }
.divergent-item .dq-text { font-weight: 600; margin-bottom: 6px; }
.divergent-item .dq-answers { color: var(--muted); font-size: 13px; }

.awards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.award-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  animation: fade-up .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.award-icon { font-size: 28px; line-height: 1; flex: none; }
.award-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--kd-teal); margin-bottom: 3px; }
.award-name { font-size: 15px; font-weight: 700; }
.award-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

@media (max-width: 420px) { .awards-grid { grid-template-columns: 1fr; } }

#shareCanvas {
  width: 100%; max-width: 300px; aspect-ratio: 9 / 16;
  display: block; margin: 0 auto 18px;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(124, 92, 255, .25);
}

.ai-desc { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: -6px 0 14px; }

.ai-result {
  margin-top: 16px;
  background: var(--kd-tint);
  border: 1px solid #f6cddf;
  border-radius: 14px;
  padding: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #0a2e29;
  animation: fade-up .35s var(--ease);
}
.ai-result-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--kd-teal-deep); margin-bottom: 8px; }

.ai-skeleton { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--panel2) 25%, var(--kd-tint) 50%, var(--panel2) 75%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skel-line.w-90 { width: 90%; }
.skel-line.w-100 { width: 100%; }
.skel-line.w-70 { width: 70%; }

/* ---------- Animasyonlar ---------- */

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-scale { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
