/* Zi Wei Dou Shu Chart — RT-CHN-093
   Widget styling. The form shell + ad/section styling come from the platform
   tool layout; this file scopes the zw-* components: the trilingual form, the
   disclaimer, and the classic 12-palace 命盤 plate (4×4 grid with a 2×2 centre).
   PINK metaphysics theme (accent #9D174D). Loaded automatically by
   show.blade.php when present. */

.zw-form { display: flex; flex-direction: column; gap: 14px; }

.zw-disclaimer {
  padding: 10px 14px; background: #fdf2f8; border-left: 3px solid #ec4899;
  border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--rt-accent); line-height: 1.55;
}

.zw-inputs {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 16px;
  background: var(--rt-surface-2); border: 1px solid var(--rt-hairline); border-radius: 8px;
}
@media (max-width: 720px) { .zw-inputs { grid-template-columns: 1fr; } }

.zw-field label {
  font-family: var(--rt-font-mono); font-size: 11px; color: var(--rt-ink-muted);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
  display: block; margin-bottom: 4px;
}
.zw-field input {
  padding: 10px 12px; border: 1px solid var(--rt-hairline); border-radius: 6px;
  font-size: 15px; background: #fff; width: 100%;
}
.zw-field input:focus {
  outline: none; border-color: #ec4899; box-shadow: 0 0 0 3px rgba(236,72,153,.12);
}

.zw-radio-group { display: flex; gap: 14px; padding: 10px 0; }
.zw-radio-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.zw-radio-group input { accent-color: #ec4899; }

.zw-missing { padding: 8px 12px; background: #fdf2f8; border-radius: 6px; font-size: 12px; color: var(--rt-ink-muted); font-style: italic; }

.zw-actions { display: flex; gap: 8px; }
.zw-btn {
  padding: 10px 18px; font-size: 13px; border-radius: 6px; cursor: pointer;
  font-family: var(--rt-font-mono); text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.zw-btn-go { background: #ec4899; color: #fff; border: 1px solid #db2777; }
.zw-btn-go:hover { background: #db2777; }
.zw-btn-reset { background: #fff; color: #9d174d; border: 1px solid rgba(236,72,153,.4); }

.zw-results { padding: 0; background: transparent; }
.zw-empty { padding: 16px; text-align: center; color: var(--rt-ink-muted); font-style: italic; }

/* ---- 12-palace plate (4×4 grid, 2×2 centre) ---- */
.zw-plate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(96px, auto));
  gap: 6px;
  padding: 6px;
  background: var(--rt-bg-inset);
  border: 1px solid var(--rt-hairline);
  border-radius: 10px;
}

.zw-cell {
  position: relative;
  display: flex; flex-direction: column;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--rt-hairline);
  border-radius: 8px;
  min-height: 96px;
}
.zw-cell-ming {
  border: 2px solid #db2777;
  box-shadow: 0 0 0 3px rgba(236,72,153,.10);
}

.zw-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.zw-palace-name {
  font-family: var(--rt-font-sans); font-size: 13px; font-weight: 700; color: #9d174d;
  letter-spacing: .02em;
}
.zw-shen-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 999px;
  background: #9d174d; color: #fff; font-size: 11px; font-weight: 700; flex: none;
}

.zw-stars { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px 7px; }
.zw-star {
  position: relative;
  font-family: var(--rt-font-sans); font-size: 14px; line-height: 1.2; white-space: nowrap;
}
.zw-star-main { font-weight: 700; color: #1a1814; }
.zw-star-aux  { font-weight: 400; color: var(--rt-ink-muted); }
.zw-star-empty { color: var(--rt-ink-muted); opacity: .4; }

/* 四化 superscript badges (祿=green / 權=blue / 科=amber / 忌=red) */
.zw-sihua {
  font-size: 9px; font-weight: 700; margin-left: 1px;
  padding: 0 2px; border-radius: 3px; vertical-align: super; line-height: 1;
}
.zw-sihua-0 { background: #dcfce7; color: #15803d; }  /* 祿 */
.zw-sihua-1 { background: #dbeafe; color: #1d4ed8; }  /* 權 */
.zw-sihua-2 { background: #fef3c7; color: #b45309; }  /* 科 */
.zw-sihua-3 { background: #fee2e2; color: #b91c1c; }  /* 忌 */

.zw-branch {
  align-self: flex-end; margin-top: 4px; padding-top: 4px;
  font-family: var(--rt-font-mono); font-size: 13px; font-weight: 700; color: var(--rt-ink-muted);
}

/* ---- centre 2×2 natal summary ---- */
.zw-center {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 14px 16px;
  background: var(--rt-result-bg); color: var(--rt-result-ink);
  border: 1px solid rgba(236,72,153,.22); border-radius: 10px;
}
.zw-c-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.zw-c-lbl {
  color: var(--rt-result-muted); font-family: var(--rt-font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
}
.zw-c-val { color: var(--rt-result-ink); font-family: var(--rt-font-sans); font-size: 14px; text-align: right; }

/* ---- responsive: ≤720px collapse the plate into a stacked list of cards ---- */
@media (max-width: 720px) {
  .zw-plate {
    display: flex; flex-direction: column; gap: 8px;
    grid-template-columns: none; grid-template-rows: none;
  }
  .zw-cell, .zw-center {
    grid-row: auto !important; grid-column: auto !important;
    width: 100%; min-height: 0;
  }
  .zw-center { order: -1; }
  .zw-cell { flex-direction: row; align-items: flex-start; gap: 10px; }
  .zw-cell-head { flex-direction: column; align-items: flex-start; min-width: 52px; margin-bottom: 0; }
  .zw-branch { align-self: flex-start; margin: 0; }
}
