/* ─── Гадание И-Цзин ─── */
/* Все классы с префиксом .ich- чтобы не пересекаться с основным css */

/* Ссылка-якорь в шапке → к секции гадания */
.ich-toplink-wrap {
  margin: 0.6rem 0 0;
}
.ich-toplink {
  display: inline-block;
  color: var(--accent-ink);
  background: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(74, 107, 58, 0.35);
  transition: background 0.12s, box-shadow 0.12s, transform 0.12s;
}
.ich-toplink:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(74, 107, 58, 0.45);
  transform: translateY(-1px);
}
/* Плавный скролл к якорю */
html { scroll-behavior: smooth; }

.ich-intro {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1rem;
}

.ich-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ich-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.ich-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.ich-btn:disabled { opacity: 0.55; cursor: wait; }
.ich-btn-again {
  background: none;
  color: var(--accent);
}
.ich-btn-again:hover { background: #f0ede2; border-color: var(--accent-dark); color: var(--accent-dark); }

/* Область с чертами + результат */
.ich-board {
  margin-top: 1.1rem;
  min-height: 2rem;
}

/* Блок шести черт */
.ich-lines {
  display: flex;
  flex-direction: column-reverse; /* первая (нижняя) черта внизу */
  gap: 6px;
  width: 140px;
  margin: 0 auto 1.2rem;
}

/* Одна черта-строка */
.ich-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 14px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ich-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ян: сплошная черта */
.ich-yang {
  flex: 1;
  height: 10px;
  background: var(--ink);
  border-radius: 2px;
}

/* Инь: две половинки с зазором */
.ich-yin-l,
.ich-yin-r {
  height: 10px;
  background: var(--ink);
  border-radius: 2px;
}
.ich-yin-l { flex: 2; }
.ich-yin-r { flex: 2; }
.ich-yin-gap { flex: 1; }

/* Результат гексаграммы */
.ich-result {
  display: none;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  animation: ich-appear 0.35s ease;
}
.ich-result.visible { display: block; }

@keyframes ich-appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ich-glyph-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.ich-glyph {
  font-size: 3rem;
  line-height: 1;
  color: var(--accent-dark);
  font-family: Georgia, serif;
  /* some fonts render these glyphs poorly; fallback is fine */
}

.ich-num {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.ich-names {
  margin-bottom: 0.5rem;
}
.ich-name-ru {
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--ink);
  margin: 0 0 0.1rem;
}
.ich-name-cn {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.ich-meaning {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  margin: 0.5rem 0 0;
}

@media (max-width: 480px) {
  .ich-lines { width: 120px; }
  .ich-glyph { font-size: 2.4rem; }
}
