/* ── I Ching Oracle — Basserli ──
   Base colors/layout from basserli-coffee-reading.css (loaded first).
   This file only defines iChing-specific structures: hexagram, lines,
   casting animation, oracle cards, and form layout. */

/* ── iChing color tokens — exact coffee palette ── */
:root {
  --ich-gold:     #efb34a;
  --ich-gold-dim: #c8882a;
  --ich-muted:    #78688f;
  --ich-border:   rgba(76,32,113,.18);
  --ich-card:     rgba(255,255,255,.58);
  --ich-shadow:   0 12px 35px rgba(48,18,77,.10);
  --ich-changing: #c0392b;
  --ich-solid:    #4c1882;
}

/* ── MAIN GRID (form + aside) ── */
.ich-main {
  max-width: 1160px;
  margin: 36px auto 0;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}

@media (max-width: 860px) {
  .ich-main { grid-template-columns: 1fr; }
}

/* ── FORM CARD ── */
.ich-form-card {
  padding: 22px;
  background: rgba(255,255,255,.5);
  border: 1px solid var(--ich-border);
  border-radius: 22px;
  box-shadow: var(--ich-shadow);
}

.ich-form-card h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 23px;
  color: #47206e;
  font-weight: 500;
}

.ich-section-label {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6126a0;
  margin: 0 0 10px;
  display: block;
}

/* ── QUESTION INPUT ── */
.ich-question-wrap {
  position: relative;
  margin-bottom: 20px;
}

.ich-question-wrap textarea {
  width: 100%;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(98,55,145,.28);
  border-radius: 14px;
  color: #2c184b;
  font-family: inherit;
  font-size: 15px;
  padding: 14px 44px 14px 16px;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color .2s;
}

.ich-question-wrap textarea:focus {
  border-color: #6126a0;
}

.ich-question-wrap textarea::placeholder {
  color: #9080aa;
}

.ich-mic-btn {
  position: absolute;
  bottom: 12px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  color: #9080aa;
  transition: color .2s;
}

.ich-mic-btn.listening {
  color: var(--ich-changing);
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

/* ── CAST BUTTON ── */
.ich-cast-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(180deg, #4c1882, #2b0b48);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: .04em;
  box-shadow: 0 12px 20px rgba(55,16,93,.25);
  transition: opacity .2s, transform .1s;
}

.ich-cast-btn:hover { opacity: .88; }
.ich-cast-btn:active { transform: scale(.98); }
.ich-cast-btn:disabled { opacity: .4; cursor: not-allowed; }

.ich-coin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
  color: #78688f;
}

.ich-coin-row .cost { color: #4c1882; font-weight: 500; }

/* ── CASTING ANIMATION STAGE ── */
.ich-casting-stage {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.ich-casting-stage.active { display: block; }

.ich-sticks-canvas {
  position: relative;
  height: 140px;
  margin: 20px auto;
  max-width: 500px;
}

.ich-stick {
  position: absolute;
  height: 3px;
  width: 80%;
  left: 10%;
  background: linear-gradient(90deg, transparent 0%, #6126a0 20%, #8c54ca 50%, #6126a0 80%, transparent 100%);
  border-radius: 2px;
  transform: translateY(-200px) rotate(0deg);
  transition: transform .6s cubic-bezier(.22,1,.36,1), opacity .4s;
  opacity: 0;
}

.ich-stick.landed {
  transform: translateY(0) rotate(var(--stick-rot));
  opacity: 1;
}

.ich-casting-label {
  font-size: 14px;
  color: #4c1882;
  letter-spacing: .1em;
  font-weight: 500;
  margin-top: 16px;
}

.ich-round-counter {
  font-size: 12px;
  color: #78688f;
  margin-top: 6px;
  letter-spacing: .06em;
}

/* ── RESULT SECTION ── */
.ich-result {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.ich-result-header {
  text-align: center;
  margin-bottom: 32px;
}

.ich-result-header h2 {
  font-size: 1.6rem;
  color: #47206e;
  font-weight: 500;
  margin: 0;
}

/* ── HEXAGRAM DISPLAY CARD ── */
.ich-hexagram-card {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(98,55,145,.28);
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--ich-shadow);
}

.ich-hex-symbol {
  font-size: 4.5rem;
  color: #4c1882;
  line-height: 1;
  display: block;
  margin-bottom: 10px;
}

.ich-hex-number {
  font-size: 11px;
  letter-spacing: .2em;
  color: #78688f;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ich-hex-name {
  font-size: 1.7rem;
  font-weight: 500;
  color: #2c184b;
  margin-bottom: 14px;
}

/* ── LINE DISPLAY ── */
.ich-lines-display {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  margin: 20px auto;
  max-width: 220px;
}

.ich-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.ich-line-pos {
  font-size: 10px;
  color: #78688f;
  width: 14px;
  text-align: center;
}

.ich-line-solid,
.ich-line-broken {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ich-line-seg {
  height: 8px;
  border-radius: 4px;
  background: var(--ich-solid);
}

.ich-line-solid .ich-line-seg { width: 120px; }
.ich-line-broken .ich-line-seg { width: 52px; }

.ich-line.changing .ich-line-seg {
  background: var(--ich-changing);
  box-shadow: 0 0 6px rgba(192,57,43,.3);
}

.ich-changing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ich-changing);
  flex-shrink: 0;
}

/* ── JUDGMENT BLOCKQUOTE ── */
.ich-judgment {
  font-style: italic;
  color: #78688f;
  font-size: 14px;
  line-height: 1.7;
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 2px solid #6126a0;
  text-align: left;
  background: rgba(98,55,145,.06);
  border-radius: 0 8px 8px 0;
}

/* ── TRANSFORMATION ARROW ── */
.ich-transforms {
  text-align: center;
  margin: 16px 0 10px;
  color: #6126a0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ich-transforms-arrow {
  font-size: 1.6rem;
  display: block;
  margin: 4px 0;
  color: #8c54ca;
}

/* Reference card — muted compared to primary hexagram card */
.ich-hexagram-card--reference {
  opacity: .82;
  background: rgba(255,255,255,.45);
  border-style: dashed;
}

/* ── INTERPRETATION CARD (dark, like coffee result-panel) ── */
.ich-interpretation-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  padding: 28px 32px;
  margin-bottom: 20px;
  background: #210843;
  border: 2px solid rgba(238,178,73,.72);
  box-shadow: 0 20px 45px rgba(39,9,72,.24);
}

.ich-interpretation-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 34%, rgba(252,182,80,.12), transparent 17rem),
    radial-gradient(circle at 80% 35%, rgba(132,73,193,.18), transparent 15rem);
  pointer-events: none;
}

.ich-oracle-title {
  position: relative;
  z-index: 1;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ich-gold);
  margin: 0 0 20px;
  text-align: center;
}

.ich-interpretation-text {
  position: relative;
  z-index: 1;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,.92);
}

.ich-interpretation-text p {
  margin: 0 0 14px;
}

.ich-interpretation-text p:last-child {
  margin-bottom: 0;
}

/* ── ACTIONS ROW ── */
.ich-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.ich-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #4c1882, #2b0b48);
  box-shadow: 0 12px 20px rgba(55,16,93,.25);
  transition: opacity .2s;
}

.ich-actions a:hover { opacity: .85; }

@media (max-width: 640px) {
  .ich-actions { grid-template-columns: 1fr; }
}

/* ── ASIDE ── */
.ich-aside {
  position: sticky;
  top: 20px;
}

.ich-aside-card {
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(103,56,151,.18), rgba(255,255,255,.54));
  border: 1px solid var(--ich-border);
  box-shadow: 0 16px 30px rgba(68,23,105,.12);
}

.ich-aside-top {
  display: grid;
  grid-template-columns: 60px 1fr 28px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.ich-aside-top img { width: 60px; border-radius: 50%; box-shadow: 0 0 0 3px var(--ich-gold); }
.ich-aside-top strong { font-size: 14px; font-weight: 500; color: #2c184b; }
.ich-aside-top p { font-size: 12px; color: #78688f; margin: 3px 0 0; }

.ich-aside-ok {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #78c862;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
}

.ich-aside-ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.58);
  border: 1px solid var(--ich-border);
  font-size: 13px;
  color: #2c184b;
  line-height: 2;
}

.ich-aside-cta {
  display: flex;
  justify-content: center;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(180deg, #4c1882, #2b0b48);
  color: #fff;
  box-shadow: 0 10px 18px rgba(55,16,93,.22);
  transition: opacity .2s;
}

.ich-aside-cta:hover { opacity: .88; }

.ich-insufficient {
  margin-top: 10px;
  font-size: 13px;
  color: #b91c1c;
  text-align: center;
}

.ich-insufficient a { color: #4c1882; font-weight: 500; text-decoration: underline; }

/* ── HOW IT WORKS ── */
.ich-steps {
  max-width: 1160px;
  margin: 24px auto 0;
  padding: 0 20px 50px;
}

.ich-steps h2 {
  font-size: 1.4rem;
  color: #47206e;
  font-weight: 500;
  margin: 0 0 24px;
  text-align: center;
}

.ich-steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 640px) {
  .ich-steps-row { grid-template-columns: 1fr; }
}

.ich-step-item {
  position: relative;
  padding: 18px;
  border: 1px solid var(--ich-border);
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  box-shadow: 0 12px 30px rgba(48,18,77,.08);
  text-align: center;
}

.ich-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #4c1882;
  color: #fff;
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(55,16,93,.24);
}

.ich-step-item h3 { font-size: 14px; color: #2c184b; font-weight: 500; margin: 0 0 6px; }
.ich-step-item p  { font-size: 13px; color: #78688f; margin: 0; line-height: 1.55; }

/* ── MOON BANNER ── */
.ich-moon-banner {
  max-width: 1160px;
  margin: 10px auto 40px;
  padding: 0 20px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(48,18,77,.22);
}

.ich-moon-banner a { display: block; }
.ich-moon-banner img { width: 100%; height: auto; border-radius: 22px; }

/* ── FLASH ── */
.ich-flash { max-width: 1160px; margin: 14px auto 0; padding: 0 20px; }
.ich-flash-error {
  padding: 14px 18px;
  background: rgba(185,28,28,.08);
  border: 1px solid rgba(185,28,28,.3);
  border-radius: 12px;
  color: #b91c1c;
  font-size: 15px;
}

/* ── HISTORY ── */
.ich-history {
  max-width: 1160px;
  margin: 0 auto 30px;
  padding: 16px 20px;
  border: 1px solid var(--ich-border);
  border-radius: 18px;
  background: rgba(255,255,255,.58);
}

.ich-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.ich-history-head h2 { font-size: 1.1rem; color: #2c184b; font-weight: 500; margin: 0; }
.ich-history-head a  { font-size: 13px; color: #4c1882; font-weight: 500; text-decoration: none; }

.ich-history-items { display: flex; flex-direction: column; gap: 8px; }

.ich-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.62);
  border: 1px solid var(--ich-border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
}

.ich-history-item span { flex: 1; color: #2c184b; font-weight: 500; }
.ich-history-item small { color: #78688f; }
.ich-history-item a { color: #4c1882; font-weight: 500; text-decoration: none; }

/* ── ERROR STYLES ── */
.ich-errors {
  margin-bottom: 14px;
  padding: 12px 16px;
  background: rgba(185,28,28,.08);
  border: 1px solid rgba(185,28,28,.28);
  border-radius: 12px;
  font-size: 14px;
  color: #b91c1c;
}

/* ── DISCLAIMER ── */
.ich-disclaimer {
  font-size: 11px;
  color: #78688f;
  text-align: center;
  margin: 12px 0 0;
  line-height: 1.5;
}

/* ── PILLS (hero) ── */
.ich-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}

.ich-pills span {
  padding: 4px 13px;
  border: 1px solid rgba(76,32,113,.25);
  border-radius: 20px;
  font-size: 12px;
  color: #6126a0;
  background: rgba(98,55,145,.08);
}

/* ── EYEBROW (hero) ── */
.ich-eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #6126a0;
  margin: 0 0 6px;
}

/* ── CHANGING LINE LABEL ── */
.ich-changing-label {
  font-size: 12px;
  color: var(--ich-changing);
  margin-top: 10px;
  letter-spacing: .06em;
}
