/* Wong Tai Sin Oracle — 黃大仙靈籤 — RT-CHN-102
   Widget styling. Temple RED / gold theme (accent #B91C1C). The form shell +
   ad/section styling come from the platform tool layout; this file scopes the
   wt-* components: the 求籤 button, the result/lot card (big 籤號 + 吉凶 badge +
   籤詩 lines), the 指定籤號 number input, and the browse grid. Loaded
   automatically by show.blade.php when present. */

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

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

/* 求籤 draw button — the hero action. */
.wt-draw-wrap { display: flex; justify-content: center; }
.wt-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, #DC2626 0%, #B91C1C 100%);
  border: 1px solid #991B1B; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(185,28,28,.28); transition: transform 120ms ease, box-shadow 120ms ease;
}
.wt-draw:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(185,28,28,.34); }
.wt-draw:active { transform: translateY(0); }

/* 指定籤號 lookup row. */
.wt-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;
}
.wt-specify-field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.wt-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;
}
.wt-specify-field input {
  padding: 10px 12px; border: 1px solid var(--rt-hairline); border-radius: 6px;
  font-size: 15px; background: #fff; width: 100%;
}
.wt-specify-field input:focus { outline: none; border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.wt-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: #991B1B; border: 1px solid rgba(185,28,28,.4);
}
.wt-lookup:hover { background: #FEF2F2; }
.wt-err { width: 100%; color: #B91C1C; font-size: 12.5px; min-height: 1em; }

/* Result / lot card. */
.wt-result { min-height: 40px; }
.wt-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.
   ==================================================================== */
.wt-paper {
  --wt-paper-bg: #FBF4DD;
  --wt-paper-bg2: #F6ECCB;
  --wt-red: #B0282C;
  --wt-ink: #3A2A18;
  --wt-ink-muted: #7A6A52;

  border: 3px solid var(--wt-red);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--wt-paper-bg) 0%, var(--wt-paper-bg2) 100%);
  color: var(--wt-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);
}

.wt-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);
}
.wt-paper-title {
  font-family: var(--rt-font-serif, serif);
  font-size: 16px; font-weight: 700; color: var(--wt-red); letter-spacing: .12em;
}
.wt-paper-no {
  font-family: var(--rt-font-serif, serif);
  font-size: 24px; font-weight: 800; color: var(--wt-red);
  letter-spacing: .02em; margin-right: auto;
}
.wt-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;
}
.wt-lvl-best.wt-level { background: #DDF0DD; color: #1F6B33; border-color: rgba(31,107,51,.35); }
.wt-lvl-mid.wt-level  { background: #F7E9C4; color: #8A5A12; border-color: rgba(138,90,18,.35); }
.wt-lvl-bad.wt-level  { background: #F3D9C9; color: #9A3324; border-color: rgba(154,51,36,.35); }

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

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

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

.wt-block-sub { margin-top: 10px; }
.wt-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(--wt-ink-muted);
  padding: 2px 8px; border: 1px solid rgba(122,106,82,.35);
  border-radius: 999px; background: rgba(255,255,255,.35);
}

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

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

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

/* Browse grid. */
.wt-browse-toggle { display: flex; justify-content: center; }
.wt-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: #991B1B; border: 1px solid rgba(185,28,28,.32);
}
.wt-browse-btn:hover { background: #FEF2F2; }
.wt-browse { }
.wt-browse-hint { font-size: 12.5px; color: var(--rt-ink-muted); margin: 6px 0 10px; text-align: center; }
.wt-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px;
}
@media (max-width: 720px) { .wt-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 480px) { .wt-grid { grid-template-columns: repeat(5, 1fr); } }
.wt-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;
}
.wt-cell:hover { border-color: #DC2626; background: #FEF2F2; }
.wt-cell.wt-lvl-best { border-left: 3px solid #15803D; }
.wt-cell.wt-lvl-mid  { border-left: 3px solid #D97706; }
.wt-cell.wt-lvl-bad  { border-left: 3px solid #DC2626; }
