/* ============================================================
   Lo Shu Grid Calculator – Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --lsgc-primary:   #7c5cbf;
  --lsgc-primary-l: #a07de0;
  --lsgc-primary-xl:#ede8f9;
  --lsgc-accent:    #5b8dee;
  --lsgc-success:   #34c985;
  --lsgc-danger:    #f06060;
  --lsgc-text:      #1a1a2e;
  --lsgc-muted:     #6b7280;
  --lsgc-border:    #e5e7eb;
  --lsgc-bg:        #f9f8ff;
  --lsgc-card-bg:   #ffffff;
  --lsgc-radius:    14px;
  --lsgc-shadow:    0 2px 18px rgba(124,92,191,.10);
}

/* ── Wrapper ────────────────────────────────────────────────── */
.lsgc-wrap {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  color: var(--lsgc-text);
  background: var(--lsgc-bg);
  border-radius: var(--lsgc-radius);
}

/* ── Card ───────────────────────────────────────────────────── */
.lsgc-card {
  background: var(--lsgc-card-bg);
  border: 1px solid var(--lsgc-border);
  border-radius: var(--lsgc-radius);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--lsgc-shadow);
}

/* ── Typography ─────────────────────────────────────────────── */
.lsgc-heading {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--lsgc-text);
}
.lsgc-subheading {
  font-size: .92rem;
  color: var(--lsgc-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}
.lsgc-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--lsgc-primary);
}
.lsgc-highlight-num {
  display: inline-block;
  background: var(--lsgc-primary-xl);
  color: var(--lsgc-primary);
  border-radius: 6px;
  padding: 1px 10px;
  font-size: 1.1rem;
}

/* ── Form ───────────────────────────────────────────────────── */
.lsgc-form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.lsgc-field {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lsgc-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--lsgc-text);
}
.lsgc-required { color: var(--lsgc-primary); }
.lsgc-input {
  padding: 11px 14px;
  border: 1.5px solid var(--lsgc-border);
  border-radius: 9px;
  font-size: .95rem;
  color: var(--lsgc-text);
  background: #fff;
  transition: border-color .2s;
  outline: none;
  box-sizing: border-box;
  width: 100%;
}
.lsgc-input:focus { border-color: var(--lsgc-primary-l); box-shadow: 0 0 0 3px rgba(124,92,191,.12); }
.lsgc-hint { font-size: .78rem; color: var(--lsgc-muted); font-style: italic; }

/* ── Buttons ────────────────────────────────────────────────── */
.lsgc-btn-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.lsgc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
}
.lsgc-btn:active { transform: scale(.97); }
.lsgc-btn-primary {
  background: linear-gradient(135deg, var(--lsgc-primary), var(--lsgc-primary-l));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124,92,191,.35);
}
.lsgc-btn-primary:hover { box-shadow: 0 6px 20px rgba(124,92,191,.45); }
.lsgc-btn-ghost {
  background: var(--lsgc-primary-xl);
  color: var(--lsgc-primary);
}
.lsgc-btn-ghost:hover { background: #e0d8f7; }

/* ── Error ──────────────────────────────────────────────────── */
.lsgc-error {
  margin-top: 12px;
  padding: 10px 16px;
  background: #fff0f0;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--lsgc-danger);
}

/* ── Numbers Strip ──────────────────────────────────────────── */
.lsgc-numbers-strip {
  display: flex;
  justify-content: space-around;
  text-align: center;
  padding: 18px 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.lsgc-strip-item { flex: 1 1 80px; }
.lsgc-strip-label { display: block; font-size: .75rem; color: var(--lsgc-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.lsgc-strip-val { display: block; font-size: 1.6rem; font-weight: 800; color: var(--lsgc-primary); }

/* ── Grid + Legend Row ──────────────────────────────────────── */
.lsgc-grid-section {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.lsgc-grid-card { flex: 0 0 auto; }
.lsgc-legend-card { flex: 1 1 200px; }

/* ── 3×3 Grid ───────────────────────────────────────────────── */
.lsgc-grid {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
  gap: 6px;
  margin-bottom: 10px;
}
.lsgc-cell {
  border: 2px solid var(--lsgc-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fafafa;
  transition: background .25s, border-color .25s, transform .2s;
  cursor: default;
}
.lsgc-cell.lsgc-filled {
  background: var(--lsgc-primary-xl);
  border-color: var(--lsgc-primary-l);
}
.lsgc-cell.lsgc-cell-center { background: #f0f0ff; border-color: #c4b5f0; }
.lsgc-cell.lsgc-cell-center.lsgc-filled { background: #ddd6f9; }
.lsgc-cell:hover { transform: scale(1.04); }

.lsgc-cell-num {
  font-size: .72rem;
  font-weight: 700;
  color: var(--lsgc-muted);
  line-height: 1;
}
.lsgc-cell-dots {
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 1px;
  min-height: 1.4rem;
  color: var(--lsgc-primary);
}
.lsgc-grid-note { font-size: .78rem; color: var(--lsgc-muted); text-align: center; margin: 0; }

/* ── Legend ─────────────────────────────────────────────────── */
.lsgc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lsgc-legend li { font-size: .88rem; color: var(--lsgc-muted); border-left: 3px solid var(--lsgc-primary-l); padding-left: 10px; }
.lsgc-legend li strong { color: var(--lsgc-primary); margin-right: 4px; }

/* ── Planes ─────────────────────────────────────────────────── */
.lsgc-planes { display: flex; flex-direction: column; gap: 14px; }
.lsgc-plane-item { display: flex; flex-direction: column; gap: 4px; }
.lsgc-plane-label { font-size: .82rem; font-weight: 600; color: var(--lsgc-text); }
.lsgc-plane-bar-wrap { background: var(--lsgc-border); border-radius: 99px; height: 8px; overflow: hidden; }
.lsgc-plane-bar { height: 100%; border-radius: 99px; background: var(--lsgc-primary); width: 0; transition: width .7s ease; }
.lsgc-bar-emotion   { background: linear-gradient(90deg,#5b8dee,#81b3ff); }
.lsgc-bar-practical { background: linear-gradient(90deg,#34c985,#6fe0af); }
.lsgc-bar-intuitive { background: linear-gradient(90deg,#f0a05a,#f5c78a); }
.lsgc-plane-desc { font-size: .8rem; color: var(--lsgc-muted); }

/* ── Present / Absent ───────────────────────────────────────── */
.lsgc-two-col { display: flex; gap: 18px; flex-wrap: wrap; }
.lsgc-two-col > .lsgc-card { flex: 1 1 200px; }
.lsgc-title-present { color: var(--lsgc-success); }
.lsgc-title-absent  { color: var(--lsgc-danger); }
.lsgc-badge-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.lsgc-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px;
  border-radius: 99px;
  font-size: .85rem; font-weight: 600;
}
.lsgc-badge-present { background: #e6faf2; color: var(--lsgc-success); border: 1px solid #a7f0cc; }
.lsgc-badge-absent  { background: #fff0f0; color: var(--lsgc-danger);  border: 1px solid #fca5a5; }
.lsgc-absent-note { font-size: .8rem; color: var(--lsgc-muted); margin: 10px 0 0; line-height: 1.5; }

/* ── Interpretation ─────────────────────────────────────────── */
.lsgc-interp-text { font-size: .93rem; color: var(--lsgc-muted); line-height: 1.7; }

/* ── Arrows / Patterns ──────────────────────────────────────── */
.lsgc-arrows-wrap { display: flex; flex-direction: column; gap: 12px; }
.lsgc-arrow-item {
  padding: 12px 16px;
  background: linear-gradient(135deg, #fef9e7, #fef3cd);
  border-left: 4px solid #f5c518;
  border-radius: 8px;
  font-size: .88rem; line-height: 1.6;
}
.lsgc-arrow-item strong { color: #b07d00; }

/* ── Report Card ────────────────────────────────────────────── */
.lsgc-report-card { background: linear-gradient(135deg, var(--lsgc-primary-xl), #e8f0ff); border-color: var(--lsgc-primary-l); }
.lsgc-report-text { font-size: .95rem; color: var(--lsgc-primary); margin: 0; font-weight: 500; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lsgc-card { padding: 18px 16px; }
  .lsgc-heading { font-size: 1.2rem; }
  .lsgc-grid { grid-template-columns: repeat(3,72px); grid-template-rows: repeat(3,72px); }
  .lsgc-numbers-strip { gap: 8px; }
  .lsgc-strip-val { font-size: 1.3rem; }
  .lsgc-grid-section { flex-direction: column; }
  .lsgc-btn { padding: 11px 20px; font-size: .9rem; }
}
