/* 配種表的內容樣式。頁首、頁尾和顏色都來自全站的 site.css，這裡只用它的變數，深淺色才會一致。 */
@font-face { font-family: "DotGothic16"; src: url("/dqm/fonts/DotGothic16-subset.woff2") format("woff2"); font-display: swap; }

.dqm {
  --font-pixel: "DotGothic16", "Hiragino Kaku Gothic ProN", var(--font-sans), monospace;
  --accent: var(--warn);
  display: flex; flex-direction: column; gap: 14px; padding-block: .5rem 1rem;
  font-size: 1rem; line-height: 1.6;
}
.dqm [hidden] { display: none !important; }
.dqm h1, .dqm h2, .dqm h3 { margin: 0; }

.masthead { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-family: var(--font-pixel); color: var(--accent); font-size: 14px; letter-spacing: .08em; }
.masthead h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.3; }
.masthead p { margin: 0; color: var(--muted); max-width: 65ch; }

/* 分頁和搜尋：捲動時停在全站頁首底下（頁首高 68px、框線 2px） */
.bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 5; background: var(--bg); padding-block: 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 2px solid var(--line); }
@media (min-width: 860px) { .bar { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: center; } }
.bar-sub { display: flex; flex-direction: column; gap: 6px; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--soft); border: 2px solid var(--line); border-radius: 14px; padding: 3px; }
.tab { font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; border-radius: 10px; padding: 7px 2px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--tile-sun); font-weight: 700; }
.tabs.links { max-width: 560px; }
.tabs.links a { text-align: center; font-size: 14px; color: var(--ink); text-decoration: none; border-radius: 10px; padding: 7px 2px; white-space: nowrap; }
.tabs.links a:hover { background: var(--panel); }
.tabs.links a[aria-current="page"] { background: var(--tile-sun); font-weight: 700; }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 2px solid var(--line-strong); border-radius: 14px; padding: 8px 40px 8px 34px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search .cursor { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 13px; pointer-events: none; }
.search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-size: 20px; width: 32px; height: 32px; cursor: pointer; border-radius: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-block: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: inherit; font-size: 14px; color: var(--ink); background: var(--soft); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 12px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.status { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.intro { margin: 0; color: var(--muted); max-width: 65ch; }

/* 規則 */
details.rules { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 2px 16px; scroll-margin-top: 86px; }
details.rules summary { cursor: pointer; padding-block: 10px; font-weight: 700; list-style: none; display: flex; gap: 8px; align-items: center; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules summary::before { content: "▶"; color: var(--accent); font-size: 12px; transition: transform .15s; }
details.rules[open] summary::before { transform: rotate(90deg); }
.rules-body { padding-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.rules-body p { margin: 0; max-width: 70ch; }
.rules-body table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.rules-body th, .rules-body td { border: 1px solid var(--line-strong); padding: 4px 10px; text-align: left; white-space: nowrap; }
.rules-body th { color: var(--accent); font-weight: 500; }
.tablebox { overflow-x: auto; }

/* 卡片：手機一欄，桌面兩欄 */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 860px) { .list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.win { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: 200px; }
.win.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--sun); } to { box-shadow: 0 0 0 0 transparent; } }
.win > h2, .gen-head h2, .all-list > h2 { font-size: 1.25rem; }
.win > p { margin: 0; max-width: 65ch; }
.group-title { grid-column: 1 / -1; font-family: var(--font-pixel); color: var(--accent); font-size: 17px; letter-spacing: .06em; padding-top: 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; scroll-margin-top: 200px; }
.group-title small { color: var(--muted); font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; }

/* 通用表 */
.gen-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gen-head h3 { font-size: 1.25rem; }
.gen-head span { font-size: 13px; color: var(--muted); }
.gen-grid { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 10px; align-items: center; margin: 0; }
.gen-grid .plus { color: var(--muted); font-family: var(--font-pixel); }
.gen-grid .res { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
table.gen { width: 100%; border-collapse: collapse; font-size: 15px; }
table.gen th { font-weight: 500; font-size: 13px; color: var(--muted); text-align: left; padding: 0 8px 4px 0; }
table.gen td { padding: 6px 8px 6px 0; border-top: 1px dashed var(--line-strong); vertical-align: top; }
table.gen th:first-child, table.gen td:first-child { width: 1%; white-space: nowrap; padding-right: 20px; }
table.gen .note { display: block; margin-top: 2px; }

/* 配方 */
.mon-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mon-head h2, .mon-head h3 { font-size: 1.25rem; }
.mon-head h3 a { color: inherit; text-decoration: none; }
.mon-head h3 a:hover { color: var(--link); text-decoration: underline; }
.jp { font-family: var(--font-pixel); color: var(--muted); font-size: 14px; }
.famtag { font-size: 13px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; }
.tag { font-size: 12px; border-radius: 6px; padding: 0 6px; border: 1px solid currentColor; }
.tag.warn { color: var(--bad); }
.perma { margin-left: auto; font-size: 13px; white-space: nowrap; }
.alias { margin: 0; font-size: 14px; color: var(--muted); }
.recipes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.recipes li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding-top: 6px; border-top: 1px dashed var(--line-strong); min-width: 0; }
.recipes li:first-child { border-top: 0; padding-top: 0; }
.lbl { font-size: 13px; color: var(--accent); font-family: var(--font-pixel); letter-spacing: .04em; }
.x { color: var(--muted); font-family: var(--font-pixel); padding-inline: 2px; }
.part { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.any { font-size: 12px; color: var(--muted); }
.fam-ref { font-size: 14px; padding: 1px 8px; border-radius: 8px; background: var(--tile-mint); border: 1.5px solid transparent; color: var(--ink); white-space: nowrap; }
a.fam-ref { text-decoration: none; }
a.fam-ref:hover { border-color: var(--mint); }
.mon-ref { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); cursor: pointer; border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 0 7px; }
a.mon-ref { display: inline-block; text-decoration: none; }
.mon-ref:hover { border-color: var(--sky); color: var(--link); }
.mon-ref.hit { background: var(--tile-sun); border-color: var(--sun); color: var(--ink); }
.res .mon-ref { font-weight: 700; }
.note { font-size: 13px; color: var(--accent); width: 100%; }
.note.warn { color: var(--bad); }
.none { margin: 0; color: var(--muted); }

/* 單隻頁：桌面左邊配法、右邊反查 */
.monster-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 860px) { .monster-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 反查 */
.reverse { grid-column: 1 / -1; border: 2px dashed var(--line-strong); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.monster-cols .reverse { grid-column: auto; }
.reverse h2 { font-size: 1.25rem; }
.reverse h2 b { color: var(--accent); font-weight: inherit; }
.reverse .sub { font-size: 14px; color: var(--muted); margin: 0; }
.rev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rev-list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 15px; }
.role { font-size: 12px; color: var(--ink); background: var(--tile-sun); border-radius: 6px; padding: 0 6px; }
.role.partner { background: var(--tile-sky); }
.arrow { color: var(--accent); font-family: var(--font-pixel); }
details.more summary { cursor: pointer; font-size: 14px; color: var(--muted); }
details.more[open] summary { margin-bottom: 8px; }
.empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 30px 0; }

/* 靜態清單 */
.all-list { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.all-list .sub { margin: 0; color: var(--muted); max-width: 65ch; }
.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.tables a { display: block; background: var(--tile-mint); border-radius: 16px; padding: 10px 14px; color: var(--ink); text-decoration: none; font-weight: 700; }
.tables a:hover { text-decoration: underline; }
.tables small { display: block; color: var(--ink); font-size: 13px; font-weight: 400; }
.fam-group { scroll-margin-top: 200px; display: flex; flex-direction: column; gap: 8px; }
.fam-group h3 { font-family: var(--font-pixel); color: var(--accent); font-size: 17px; letter-spacing: .06em; padding-top: 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fam-group h3 small { color: var(--muted); font-family: var(--font-sans); font-size: 13px; letter-spacing: 0; }
.name-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 8px; }
.name-list a { display: block; padding: 4px 10px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.35; min-height: 44px; }
.name-list a:hover { border-color: var(--sky); color: var(--link); }
.name-list .jp { display: block; font-size: 12px; overflow-wrap: anywhere; }

/* 全站頁尾的連結預設換行，來源說明要留在句子裡 */
.s-footer-note a { display: inline; color: var(--link); text-decoration: underline; padding-block: 0; }

@media (prefers-reduced-motion: reduce) { .win.flash { animation: none; } details.rules summary::before { transition: none; } }
