/* Радар Сердца — стили. Использует переменные из /css/style.css
   (--bg, --accent, --accent-2, --accent-dark, --muted, --line, --surface,
   --radius, --shadow, --font-display). */

.rd-hero {
  padding: 40px 0 8px;
  text-align: center;
}

.rd-eyebrow {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.rd-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  color: var(--accent-dark);
  margin: 0 0 14px;
}

.rd-lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  max-width: 58ch;
  margin: 0 auto 22px;
}

/* ===== Кокпит: радар + консоль ===== */

.rd-cockpit {
  padding: 28px 0 60px;
}

.rd-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 36px;
  align-items: start;
}

.rd-scope-col {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rd-scope-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 10px;
  background: linear-gradient(145deg, #3a2a1a, #1c130c);
  box-shadow: 0 18px 40px rgba(20, 12, 5, 0.45), inset 0 0 0 2px rgba(224, 167, 51, 0.35);
}

.rd-scope-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.rd-ring {
  fill: none;
  stroke: rgba(224, 167, 51, 0.22);
  stroke-width: 0.6;
  transition: stroke 0.6s ease, stroke-width 0.6s ease;
}

.rd-ring.is-active {
  stroke: rgba(242, 183, 5, 0.85);
  stroke-width: 1.1;
  filter: drop-shadow(0 0 3px rgba(242, 183, 5, 0.6));
}

.rd-cross {
  stroke: rgba(224, 167, 51, 0.12);
  stroke-width: 0.4;
}

.rd-cross--diag {
  stroke: rgba(224, 167, 51, 0.07);
}

.rd-core-glow {
  fill: rgba(242, 183, 5, 0.35);
  filter: blur(3px);
  animation: rd-core-pulse 3.4s ease-in-out infinite;
}

#rdCore {
  transition: filter 0.6s ease;
  animation: rd-core-bob 3.4s ease-in-out infinite;
}

#rdCore.is-warm .rd-core-glow {
  fill: rgba(255, 208, 60, 0.6);
  animation-duration: 1.8s;
}

#rdCore.is-warm {
  filter: drop-shadow(0 0 10px rgba(255, 208, 60, 0.8));
}

#rdCore.is-cool {
  filter: grayscale(0.4) brightness(0.75);
}

@keyframes rd-core-pulse {
  0%, 100% { r: 19; opacity: 0.6; }
  50% { r: 23; opacity: 0.9; }
}

@keyframes rd-core-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

/* Развёртка луча — вращающийся конус поверх диска */

.rd-scope-sweep {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    rgba(242, 183, 5, 0.55) 0deg,
    rgba(242, 183, 5, 0.12) 18deg,
    transparent 55deg,
    transparent 360deg
  );
  mix-blend-mode: screen;
  animation: rd-sweep-rotate 5.5s linear infinite;
}

@keyframes rd-sweep-rotate {
  to { transform: rotate(360deg); }
}

/* Блики пойманных сигналов */

.rd-blip {
  fill: #ffd23c;
  filter: drop-shadow(0 0 3px rgba(255, 210, 60, 0.9));
  animation: rd-blip-in 0.5s ease, rd-blip-pulse 2.4s ease-in-out infinite 0.5s;
}

@keyframes rd-blip-in {
  from { r: 0; opacity: 0; }
  to { r: 2.6; opacity: 1; }
}

@keyframes rd-blip-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.rd-scope-caption {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
  max-width: 32ch;
  transition: color 0.3s ease;
}

/* Вкладки-контуры под радаром */

.rd-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.rd-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rd-tab span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.rd-tab.is-active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.rd-tab.is-active span {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.rd-tab.is-done span {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: var(--accent);
  color: #fff8f1;
}

.rd-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Консоль ===== */

.rd-console {
  min-width: 0;
}

.rd-contour {
  animation: rd-fade-in 0.5s ease;
}

@keyframes rd-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.rd-contour-eyebrow {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.rd-contour h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 28px);
  color: var(--accent-dark);
  margin: 0 0 12px;
}

.rd-contour-text {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

.rd-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.rd-card-title {
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 14px;
}

.rd-slider-label {
  display: block;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.rd-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
}

.rd-slider-value {
  text-align: center;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--accent);
  margin-top: 8px;
}

.rd-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.rd-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.rd-chip.is-on {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff8f1;
  border-color: var(--accent);
  transform: scale(1.03);
}

.rd-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rd-add-form input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
}

.rd-scene {
  font-style: italic;
  color: var(--ink-soft);
  background: var(--bg);
  border-left: 3px solid var(--accent-2);
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 16px;
}

.rd-archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rd-archetype-grid button,
.rd-choice-grid button {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.rd-archetype-grid button:hover,
.rd-choice-grid button:hover {
  border-color: var(--accent-2);
}

.rd-archetype-grid button.is-picked,
.rd-choice-grid button.is-picked {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff8f1;
  border-color: var(--accent);
}

.rd-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 560px) {
  .rd-choice-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rd-feedback {
  background: rgba(184, 107, 45, 0.08);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
  animation: rd-fade-in 0.35s ease;
}

.rd-progress-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.rd-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rd-field-label {
  display: block;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 14px 0 6px;
  font-size: 14px;
}

.rd-field-label:first-child {
  margin-top: 0;
}

.rd-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
}

.rd-textarea {
  resize: vertical;
  min-height: 70px;
}

.rd-builder .btn {
  margin-top: 18px;
}

.rd-thanks-card {
  background: linear-gradient(135deg, rgba(184, 107, 45, 0.1), rgba(139, 69, 24, 0.04)), var(--surface);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  animation: rd-fade-in 0.5s ease;
}

.rd-thanks-seal {
  font-size: 32px;
  margin-bottom: 10px;
}

.rd-thanks-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-dark);
  line-height: 1.6;
  margin-bottom: 18px;
  white-space: pre-line;
}

/* ===== Раскрытие «Радар = Совесть» ===== */

.rd-reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 15, 10, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: rd-fade-in 0.4s ease;
}

.rd-reveal[hidden] {
  display: none;
}

.rd-reveal-inner {
  max-width: 420px;
  text-align: center;
  color: #fff8f1;
}

.rd-reveal-dragon {
  width: 150px;
  height: 150px;
  margin: 0 auto 24px;
  animation: rd-reveal-pulse 2.2s ease-in-out infinite;
}

@keyframes rd-reveal-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(242, 183, 5, 0.6)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 42px rgba(242, 183, 5, 0.95)); }
}

.rd-reveal-svg {
  width: 100%;
  height: 100%;
}

.rd-reveal-text {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  margin-bottom: 22px;
}

/* ===== Финал: сборка Благодарности открывает Радар ===== */

.rd-finale {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  background: radial-gradient(circle at 50% 42%, rgba(70, 46, 14, 0.94), rgba(8, 6, 4, 0.98));
}

.rd-finale[hidden] {
  display: none;
}

.rd-finale-stage {
  position: relative;
  width: min(480px, 88vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-finale-goddess {
  position: relative;
  z-index: 2;
  width: 82%;
  border-radius: 18px;
  opacity: 0;
  transform: scale(0.55);
  animation:
    rd-finale-rise 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
    rd-finale-glow 2.8s ease-in-out 2.4s infinite;
}

.rd-finale-disc {
  width: 94%;
  border-radius: 26px;
}

.rd-finale-orbit {
  position: absolute;
  inset: -22%;
  z-index: 1;
  opacity: 0;
  animation:
    rd-finale-spin 8s linear infinite,
    rd-finale-fadein 1s ease 1.6s forwards;
}

.rd-finale-dragon {
  position: absolute;
  top: 2%;
  left: 50%;
  width: 34%;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  transform: translate(-50%, -10%);
  animation: rd-finale-spin-reverse 8s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 205, 60, 0.75));
}

.rd-finale-text {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 28px);
  color: #ffe9b0;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 205, 60, 0.5);
  opacity: 0;
  animation: rd-finale-fadein 1.2s ease 3.4s forwards;
}

.rd-finale-btn {
  opacity: 0;
  animation: rd-finale-fadein 1.2s ease 3.8s forwards;
}

@keyframes rd-finale-rise {
  0% { opacity: 0; transform: scale(0.55); }
  70% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes rd-finale-glow {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(255, 215, 80, 0.5)); }
  50% { filter: drop-shadow(0 0 36px rgba(255, 215, 80, 0.95)); }
}

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

@keyframes rd-finale-spin-reverse {
  to { transform: translate(-50%, -10%) rotate(-360deg); }
}

@keyframes rd-finale-fadein {
  to { opacity: 1; }
}

/* ===== Мобильная адаптация ===== */

@media (max-width: 900px) {
  .rd-cockpit-grid {
    grid-template-columns: 1fr;
  }

  .rd-scope-col {
    position: static;
  }

  .rd-scope-frame {
    max-width: 240px;
  }
}

@media (max-width: 480px) {
  .rd-hero {
    padding: 28px 0 4px;
  }

  .rd-scope-frame {
    max-width: 190px;
  }

  .rd-tab span {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .rd-tab {
    font-size: 11px;
    padding: 6px 10px 6px 6px;
  }

  .rd-card {
    padding: 16px 16px;
  }

  .rd-archetype-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rd-scope-sweep,
  #rdCore,
  .rd-core-glow,
  .rd-blip,
  .rd-contour,
  .rd-feedback,
  .rd-thanks-card,
  .rd-reveal,
  .rd-reveal-dragon,
  .rd-finale-goddess,
  .rd-finale-orbit,
  .rd-finale-dragon,
  .rd-finale-text,
  .rd-finale-btn {
    animation: none !important;
  }

  .rd-finale-goddess,
  .rd-finale-orbit,
  .rd-finale-text,
  .rd-finale-btn {
    opacity: 1 !important;
    transform: none !important;
  }
}
