/* ============================================================
   E-計算！ Fortune — タロット（tarot.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラスは tr- で始める。
   形は数秘術のページ（css/suuhijutsu.css）にそろえた。
   ============================================================ */

/* ページ上部の要点 */
.tr-quick { margin: 4px 0 20px; }
.tr-quick ul { margin: 2px 0 0; }
.tr-quick li { margin: 2px 0; }

/* ---- 入力 ---- */
.tr-lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.tr-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tr-seg label { position: relative; display: block; min-width: 0; cursor: pointer; }
.tr-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tr-seg span {
  display: block; padding: 10px 4px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.35;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-2); overflow-wrap: anywhere;
}
.tr-seg span small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
@media (max-width: 360px) { .tr-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 占いたいこと：5つを1列に（スマホで「カードを引く」まで最初の画面に収めるため）。相手の気持ちのあいだは選べない */
.tr-seg.tr-seg-q { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tr-seg.tr-seg-q span { padding: 8px 2px; font-size: 13px; }
.tr-seg input:disabled + span { opacity: .45; cursor: default; }
@media (max-width: 360px) { .tr-seg.tr-seg-q { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tr-seg input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tr-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
details.tr-more { margin: 12px 0 14px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 2px 0; }
details.tr-more > summary { cursor: pointer; padding: 10px 2px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
details.tr-more[open] > summary { margin-bottom: 4px; }
.tr-rule { display: grid; gap: 6px; }
.tr-rule label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.6; cursor: pointer; min-width: 0; }
.tr-rule input { margin-top: 5px; flex: none; }
.tr-hint { margin: 6px 0 0; }
html[data-ui="v2"] select.tr-sel { width: 100%; max-width: 100%; min-width: 0; }
.tr-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- 結果 ---- */
html[data-ui="v2"] .tr-out .res-hero .big b { font-size: clamp(26px, 8vw, 40px); overflow-wrap: anywhere; }
html[data-ui="v2"] .tr-out .res-hero .big span { white-space: nowrap; }
html[data-ui="v2"] .tr-out .res-hero .sub { overflow-wrap: anywhere; }
html[data-ui="v2"] .tr-out .res-mini > div { min-width: 0; }
html[data-ui="v2"] .tr-out .res-mini .v { overflow-wrap: anywhere; font-size: 17px; }
html[data-ui="v2"] .tr-out .res-mini .s { overflow-wrap: anywhere; }
@media (max-width: 400px) { html[data-ui="v2"] .tr-out .res-mini .v { font-size: 15px; } }
#resultPanel [hidden] { display: none !important; }
#result { min-height: 200px; }
.tr-rule-line { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); padding: 8px 10px; background: var(--page); border-radius: var(--r); }
.tr-again { margin: 12px 0 0; }
.tr-h3 { margin: 18px 0 6px; font-size: 15px; }
.tr-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* カード（画像は 220×378。逆位置は絵を180度回す） */
.tr-spread { margin: 14px 0 0; }
.tr-card { margin: 0; min-width: 0; text-align: center; }
.tr-card .tr-img { position: relative; display: block; aspect-ratio: 220 / 378; border-radius: 6px; overflow: hidden; background: var(--page); border: 1px solid var(--grid); }
.tr-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-card.tr-rev img { transform: rotate(180deg); }
.tr-card .tr-back { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--accent-soft) 0 6px, var(--surface) 6px 12px); }
.tr-card figcaption { margin-top: 4px; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.tr-card figcaption b { display: block; font-size: 14px; }
.tr-pos { display: block; font-size: 11.5px; color: var(--muted); }
.tr-en { display: block; font-size: 11px; color: var(--muted); }
.tr-dir { display: inline-block; margin-top: 2px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent); }
.tr-card.tr-rev .tr-dir { background: var(--page); color: var(--ink); border: 1px solid var(--line-strong); }

.tr-one { display: grid; grid-template-columns: minmax(0, 170px); justify-content: center; }
.tr-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ケルト十字（Waite の本の図と同じ置き方：6 が左、5 が右、7〜10 は右の列を下から上へ） */
.tr-celtic {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; max-width: 420px; margin-left: auto; margin-right: auto;
  grid-template-areas: ". c3 . c10" "c6 cen c5 c9" "c6 cen c5 c8" ". c4 . c7";
}
.tr-celtic .tr-card figcaption b { font-size: 12px; }
.tr-celtic .tr-card figcaption .tr-en, .tr-celtic .tr-card figcaption .tr-dir { display: none; }
.tr-celtic .tr-num { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.tr-celtic .tr-c3 { grid-area: c3; } .tr-celtic .tr-c4 { grid-area: c4; } .tr-celtic .tr-c5 { grid-area: c5; align-self: center; } .tr-celtic .tr-c6 { grid-area: c6; align-self: center; }
.tr-celtic .tr-c7 { grid-area: c7; } .tr-celtic .tr-c8 { grid-area: c8; } .tr-celtic .tr-c9 { grid-area: c9; } .tr-celtic .tr-c10 { grid-area: c10; }
.tr-celtic .tr-cen { grid-area: cen; align-self: center; position: relative; }
.tr-celtic .tr-cross { position: absolute; left: 50%; top: 32%; width: 66%; transform: translate(-50%, -50%) rotate(90deg); z-index: 1; }
.tr-celtic .tr-cross figcaption { display: none; }
.tr-celtic .tr-cross.tr-rev { transform: translate(-50%, -50%) rotate(270deg); }
.tr-celtic .tr-cross.tr-rev img { transform: none; }
.tr-celtic .tr-cross .tr-img { box-shadow: 0 0 0 2px var(--surface); }
.tr-celtic.tr-down .tr-cross { opacity: .92; }
.tr-sigline { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 400px) { .tr-celtic { gap: 6px; } .tr-celtic .tr-card figcaption b { font-size: 11px; } }

/* 解釈（本の説明の紹介）：計算（抽選）と見た目で分ける */
.tr-interp-tag { display: inline-block; margin: 4px 0 8px; padding: 1px 10px; border-radius: 999px; font-size: 12px; background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.tr-interp-box { margin: 16px 0 0; padding: 12px 14px; border: 1px dashed var(--grid); border-radius: var(--r); background: var(--page); min-width: 0; }
.tr-in { min-width: 0; margin: 0 0 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); }
.tr-in b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; overflow-wrap: anywhere; }
.tr-in p { margin: 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.tr-in p.tr-posd { font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; }
.tr-in-note { margin: 4px 0 6px; }

/* 方式ごとの比較表 */
html[data-ui="v2"] table.data.tr-cmp { width: 100%; }
html[data-ui="v2"] table.data.tr-cmp th, html[data-ui="v2"] table.data.tr-cmp td { white-space: normal; vertical-align: top; font-size: 13px; line-height: 1.6; }
html[data-ui="v2"] table.data.tr-cmp td { min-width: 6em; }
html[data-ui="v2"] table.data.tr-cmp td.tr-diff { font-weight: 700; color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.tr-cmp-note { margin: 6px 0 0; }

/* ---- 本文の表 ---- */
html[data-ui="v2"] table.data.tr-st td, html[data-ui="v2"] table.data.tr-st th { white-space: normal; }
html[data-ui="v2"] table.data.tr-st td.n { white-space: normal; overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.tr-mt th, html[data-ui="v2"] table.data.tr-mt td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.6; }
html[data-ui="v2"] table.data.tr-mt td.tr-diff { font-weight: 700; color: var(--accent); }
html[data-ui="v2"] table.data.tr-it { width: 100%; }
html[data-ui="v2"] table.data.tr-it th, html[data-ui="v2"] table.data.tr-it td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.tr-it td { min-width: 12em; }
html[data-ui="v2"] table.data.tr-it tbody th { min-width: 7em; }
html[data-ui="v2"] table.data.tr-it th .sub { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
details.tr-list { margin: 10px 0 0; border-top: 1px solid var(--grid); }
details.tr-list > summary { cursor: pointer; padding: 10px 2px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.tr-formula { padding: 10px 12px; background: var(--page); border-radius: var(--r); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* 狭い画面では、意味の表と比較表を1行ずつ縦に並べる（横スクロールを出さない） */
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.tr-it thead, html[data-ui="v2"] table.data.tr-cmp thead { display: none; }
  html[data-ui="v2"] table.data.tr-it, html[data-ui="v2"] table.data.tr-it tbody, html[data-ui="v2"] table.data.tr-it tr,
  html[data-ui="v2"] table.data.tr-it th, html[data-ui="v2"] table.data.tr-it td,
  html[data-ui="v2"] table.data.tr-cmp, html[data-ui="v2"] table.data.tr-cmp tbody, html[data-ui="v2"] table.data.tr-cmp tr,
  html[data-ui="v2"] table.data.tr-cmp th, html[data-ui="v2"] table.data.tr-cmp td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.tr-it tr, html[data-ui="v2"] table.data.tr-cmp tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.tr-it tbody th, html[data-ui="v2"] table.data.tr-cmp tbody th { border: 0; padding-bottom: 2px; }
  html[data-ui="v2"] table.data.tr-it td, html[data-ui="v2"] table.data.tr-cmp td { border: 0; padding-top: 2px; }
  html[data-ui="v2"] table.data.tr-it td::before, html[data-ui="v2"] table.data.tr-cmp td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
}
