/* results.css — стили живого виджета результатов */

.results-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .results-grid { grid-template-columns: 1fr; }
}

/* Левая колонка — большой счётчик */
.results-counter {
  background: var(--ink);
  color: var(--bg);
  border-radius: 22px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
[data-mood="forest"] .results-counter { background: var(--accent-2); color: var(--ink); }

.results-counter::before {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 200px;
  height: 200px;
  border: 1px solid color-mix(in oklab, currentColor 12%, transparent);
  border-radius: 50%;
}
.results-counter::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 80px;
  height: 80px;
  border: 1px solid color-mix(in oklab, currentColor 20%, transparent);
  border-radius: 50%;
}

.r-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.r-num {
  font-family: var(--f-display);
  font-size: clamp(72px, 9vw, 128px);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 12px 0;
}
.r-foot {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6dd96d;
  box-shadow: 0 0 0 0 #6dd96d;
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(109, 217, 109, 0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(109, 217, 109, 0); }
  100% { box-shadow: 0 0 0 0   rgba(109, 217, 109, 0); }
}

/* Правая колонка — слова */
.results-words {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.r-words-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.r-sub {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.r-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.r-bar {
  opacity: 0;
  animation: r-bar-in .6s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes r-bar-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}
.r-bar-track {
  height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}
.r-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--accent-2)));
  border-radius: 3px;
  transition: width 1s cubic-bezier(.2,.7,.2,1);
}
.r-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
}
.r-word {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-transform: lowercase;
}
.r-word::first-letter { text-transform: uppercase; }
.r-count {
  font-size: 13px;
  color: var(--ink-mute);
}

/* Skeleton — пока загружаются данные */
.r-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.r-skel {
  height: 22px;
  background: var(--line-soft);
  border-radius: 6px;
  animation: skel-pulse 1.4s ease-in-out infinite;
}
@keyframes skel-pulse {
  0%, 100% { opacity: 1;   }
  50%      { opacity: 0.45;}
}

/* Empty state — пока мало текстовых ответов */
.r-empty-words {
  padding: 24px 0;
}
.r-empty-words p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 48ch;
}

/* Empty state when backend unavailable */
.results-empty {
  padding: 48px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink-soft);
}

.results-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-mute);
}
.results-foot .mono {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.results-foot .r-link {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Облако тегов */
.r-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px 22px;
  padding: 8px 0;
  font-family: var(--f-display);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.r-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  opacity: 0;
  animation: r-tag-in .6s cubic-bezier(.2,.7,.2,1) forwards;
  text-transform: lowercase;
  transition: color .2s ease;
}
.r-tag:hover { color: var(--accent); }
.r-tag-n {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  font-weight: 500;
  font-style: normal;
}
@keyframes r-tag-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.r-cloud-skel {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0;
}

/* Анализ закрытых вопросов — переписан */
.results-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}
@media (max-width: 720px) {
  .results-choice-grid { grid-template-columns: 1fr; }
}
.results-choice-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 28px 24px;
}
.results-choice-card > .r-label {
  display: block;
  margin-bottom: 18px;
  color: var(--ink-mute);
}
.results-choice-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.result-choice-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.result-choice-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.35;
}
.result-choice-meta b {
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.result-choice-row .r-bar-track {
  background: color-mix(in oklab, var(--line) 70%, transparent);
}
