/* Guanyin Oracle — 觀音靈籤 — RT-CHN-103
   Widget styling. JADE / teal-green theme (accent #0D9488). The form shell +
   ad/section styling come from the platform tool layout; this file scopes the
   gy-* components: the 求籤 button, the rich result/lot card (big 籤號 + 典故名 +
   吉凶 badge + 籤詩 lines + 卦象 + 籤解 + 分類解籤 grid + collapsible 典故), the
   指定籤號 number input, and the browse grid. Loaded automatically by
   show.blade.php when present. */

.gy-form { display: flex; flex-direction: column; gap: 16px; }

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

/* 求籤 draw button — the hero action. */
.gy-draw-wrap { display: flex; justify-content: center; }
.gy-draw {
  padding: 14px 40px; font-size: 17px; font-weight: 700; cursor: pointer;
  font-family: var(--rt-font-sans); letter-spacing: .04em;
  color: #fff; background: linear-gradient(180deg, #14B8A6 0%, #0D9488 100%);
  border: 1px solid #0F766E; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(13,148,136,.28); transition: transform 120ms ease, box-shadow 120ms ease;
}
.gy-draw:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(13,148,136,.34); }
.gy-draw:active { transform: translateY(0); }

/* 指定籤號 lookup row. */
.gy-specify {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 14px 16px; background: var(--rt-surface-2);
  border: 1px solid var(--rt-hairline); border-radius: 8px;
}
.gy-specify-field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.gy-specify-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;
}
.gy-specify-field input {
  padding: 10px 12px; border: 1px solid var(--rt-hairline); border-radius: 6px;
  font-size: 15px; background: #fff; width: 100%;
}
.gy-specify-field input:focus { outline: none; border-color: #14B8A6; box-shadow: 0 0 0 3px rgba(20,184,166,.14); }
.gy-lookup {
  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;
  background: #fff; color: #0F766E; border: 1px solid rgba(13,148,136,.4);
}
.gy-lookup:hover { background: #F0FDFA; }
.gy-err { width: 100%; color: #B91C1C; font-size: 12.5px; min-height: 1em; }

/* Result / lot card. */
.gy-result { min-height: 40px; }
.gy-empty { padding: 18px; text-align: center; color: var(--rt-ink-muted); font-style: italic; }

/* ====================================================================
   籤紙 — the physical oracle-lot paper.
   Warm parchment ground + thick RED frame. Dark ink on cream is the
   readable baseline; red is reserved for the frame, header and poem.
   ==================================================================== */
.gy-paper {
  --gy-paper-bg: #FBF4DD;
  --gy-paper-bg2: #F6ECCB;
  --gy-red: #B0282C;
  --gy-ink: #3A2A18;
  --gy-ink-muted: #7A6A52;

  border: 3px solid var(--gy-red);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gy-paper-bg) 0%, var(--gy-paper-bg2) 100%);
  color: var(--gy-ink);
  padding: 24px 26px 22px;
  box-shadow: 0 2px 10px rgba(176,40,44,.10), inset 0 0 0 1px rgba(176,40,44,.14);
}

.gy-paper-head {
  display: flex; align-items: center; gap: 10px 14px;
  flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(176,40,44,.35);
}
.gy-paper-title {
  font-family: var(--rt-font-serif, serif);
  font-size: 16px; font-weight: 700; color: var(--gy-red); letter-spacing: .12em;
}
.gy-paper-no {
  font-family: var(--rt-font-serif, serif);
  font-size: 24px; font-weight: 800; color: var(--gy-red);
  letter-spacing: .02em; margin-right: auto;
}
.gy-level {
  font-family: var(--rt-font-mono, monospace);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.gy-lvl-best.gy-level { background: #DDF0DD; color: #1F6B33; border-color: rgba(31,107,51,.35); }
.gy-lvl-mid.gy-level  { background: #F7E9C4; color: #8A5A12; border-color: rgba(138,90,18,.35); }
.gy-lvl-bad.gy-level  { background: #F3D9C9; color: #9A3324; border-color: rgba(154,51,36,.35); }

/* 籤詩 (poem): red, larger, centred. */
.gy-poem { text-align: center; margin-bottom: 14px; }
.gy-poem-line {
  margin: 0 0 8px;
  font-family: var(--rt-font-serif, serif);
  font-size: 20px; line-height: 1.85; color: var(--gy-red);
  font-weight: 600; letter-spacing: .02em;
}
.gy-poem-gloss {
  margin: 0 0 12px;
  font-size: 13px; line-height: 1.6; color: var(--gy-ink-muted); font-style: italic;
}
.gy-poem-gloss:last-child, .gy-poem-line:last-child { margin-bottom: 0; }

/* 典故名 (gushiName) line. */
.gy-gushi {
  margin: 0 0 14px; text-align: center;
  font-size: 14px; color: var(--gy-ink); line-height: 1.6;
}
.gy-gushi-tag { font-weight: 700; color: var(--gy-red); }
.gy-gushi-en { display: block; font-size: 12.5px; color: var(--gy-ink-muted); font-style: italic; }

/* 解曰 (jie) reading block. */
.gy-section { margin: 0 0 14px; }
.gy-section-head {
  margin: 0 0 8px;
  font-family: var(--rt-font-serif, serif);
  font-size: 15px; font-weight: 700; color: var(--gy-red); letter-spacing: .04em;
  padding-bottom: 4px; border-bottom: 1px solid rgba(176,40,44,.22);
}
.gy-block { margin: 0; }
.gy-block-line { margin: 0 0 5px; font-size: 14px; line-height: 1.7; color: var(--gy-ink); }
.gy-block-line:last-child { margin-bottom: 0; }
.gy-block-en { color: var(--gy-ink-muted); }

.gy-block-sub { margin-top: 10px; }
.gy-sub-label {
  display: inline-block; margin-bottom: 5px;
  font-family: var(--rt-font-mono, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gy-ink-muted);
  padding: 2px 8px; border: 1px solid rgba(122,106,82,.35);
  border-radius: 999px; background: rgba(255,255,255,.35);
}

/* 典故 (story) — collapsible. */
.gy-story { border-top: 1px dashed rgba(176,40,44,.35); padding-top: 12px; margin-bottom: 14px; }
.gy-story-summary {
  cursor: pointer; list-style: none;
  font-family: var(--rt-font-serif, serif);
  font-size: 15px; font-weight: 700; color: var(--gy-red); letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px;
}
.gy-story-summary::-webkit-details-marker { display: none; }
.gy-story-summary::before {
  content: '▸'; font-size: 12px; transition: transform .15s ease; color: var(--gy-red);
}
.gy-story[open] > .gy-story-summary::before { transform: rotate(90deg); }
.gy-story-body { margin-top: 10px; }

/* Reflection note — kept on the parchment. */
.gy-reflect {
  margin: 0; padding: 12px 16px;
  background: rgba(255,255,255,.40); border-left: 3px solid var(--gy-red);
  border-radius: 0 6px 6px 0;
  font-size: 13px; color: var(--gy-ink); line-height: 1.6;
}

@media (max-width: 560px) {
  .gy-paper { padding: 16px 16px 14px; }
  .gy-poem-line { font-size: 18px; }
  .gy-paper-no { font-size: 20px; }
}

/* Browse grid. */
.gy-browse-toggle { display: flex; justify-content: center; }
.gy-browse-btn {
  padding: 9px 20px; font-size: 12.5px; cursor: pointer; border-radius: 999px;
  font-family: var(--rt-font-mono); text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
  background: #fff; color: #0F766E; border: 1px solid rgba(13,148,136,.34);
}
.gy-browse-btn:hover { background: #F0FDFA; }
.gy-browse-hint { font-size: 12.5px; color: var(--rt-ink-muted); margin: 6px 0 10px; text-align: center; }
.gy-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
@media (max-width: 720px) { .gy-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 480px) { .gy-grid { grid-template-columns: repeat(5, 1fr); } }
.gy-cell {
  padding: 8px 0; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--rt-hairline); background: #fff;
  font-variant-numeric: tabular-nums; transition: background 100ms ease, border-color 100ms ease;
}
.gy-cell:hover { border-color: #14B8A6; background: #F0FDFA; }
.gy-cell.gy-lvl-best { border-left: 3px solid #15803D; }
.gy-cell.gy-lvl-mid  { border-left: 3px solid #D97706; }
.gy-cell.gy-lvl-bad  { border-left: 3px solid #DC2626; }
