/* 共有・一覧・モンスターの各ページ */
.page { max-width: 1100px; margin: 0 auto; padding-block: 24px 60px; padding-inline: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-head h1, .view-head h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 4vw, 32px); text-wrap: balance; line-height: 1.25; }
.page-head .sub, .view-head .sub { margin: 6px 0 0; color: var(--muted); max-width: 68ch; }
.topbar-links a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.error { color: var(--warn); font-weight: 700; }
.count { color: var(--muted); font-size: 13px; margin: 0; }

.view-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.view-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.howto-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px; }
.howto-box summary { cursor: pointer; font-weight: 700; }
.howto-box p { margin: 8px 0 0; color: var(--muted); }
.howto-box b { color: var(--ink); }
.palette-box summary { cursor: pointer; color: var(--muted); }
#vScaler { width: 794px; max-width: 100%; margin: 0 auto; overflow: hidden; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.filters .f { min-width: 120px; }
.filters .grow { flex: 1 1 240px; }

/* 公開キャラ一覧 */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.char-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.char-card:hover { border-color: var(--accent); }
.char-thumb { width: 76px; height: 96px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.char-thumb img { width: 100%; height: 100%; object-fit: cover; }
.char-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.char-body b { font-family: var(--font-display); font-size: 17px; line-height: 1.3; word-break: break-all; }
.char-body span { font-size: 13px; }
.char-body small { color: var(--muted); font-size: 12px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tags span { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }

/* モンスター */
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg); padding: 6px 0; }
.bulkbar #count { color: var(--muted); font-size: 13px; margin-right: auto; }
.mon-list { display: flex; flex-direction: column; gap: 6px; }
.mon-wrap { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; align-items: start; }
.mon-sel { margin-top: 14px; justify-self: center; }
.mon { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.mon[open] { border-color: var(--muted); }
.mon summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) 120px 70px 64px 70px auto; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; }
.mon summary::-webkit-details-marker { display: none; }
.mon-name { display: flex; flex-direction: column; min-width: 0; }
.mon-name b { font-size: 15px; line-height: 1.3; }
.mon-name small { color: var(--muted); font-size: 11.5px; font-family: var(--font-label); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-tag { font-size: 12px; color: var(--muted); }
.mon-tag em { font-style: normal; background: var(--brass-soft); color: var(--brass); border-radius: 4px; padding: 0 5px; margin-right: 4px; font-weight: 700; }
.mon-cr { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.mon-num { font-size: 13px; font-variant-numeric: tabular-nums; }
.mon-btns { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 760px) {
  .mon summary { grid-template-columns: minmax(0, 1fr) auto; }
  .mon-tag, .mon-num { display: none; }
  .mon-btns { grid-column: 1 / -1; justify-content: flex-start; }
}
.mon-body { padding: 0 14px 14px; }
.statblock { border-top: 2px solid var(--accent); padding-top: 10px; font-size: 13.5px; }
.statblock .sb-type { margin: 0 0 8px; font-style: italic; color: var(--muted); }
.statblock dl { margin: 0; }
.statblock dl div { display: flex; gap: 8px; padding: 2px 0; }
.statblock dt { font-weight: 700; color: var(--accent); white-space: nowrap; }
.statblock dd { margin: 0; min-width: 0; }
.sb-abs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 10px 0; max-width: 480px; }
.sb-abs div { text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 4px 0; display: flex; flex-direction: column; }
.sb-abs span { font-size: 11px; color: var(--muted); }
.sb-abs b { font-family: var(--font-display); font-size: 17px; }
.sb-abs small { color: var(--brass); font-weight: 700; }
.statblock h4 { margin: 14px 0 6px; font-family: var(--font-display); color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.sb-sec p { margin: 6px 0; max-width: 80ch; }
.sb-sec p.raw { color: var(--muted); }
.sb-sec p.raw::after { content: "（原文）"; font-size: 11px; }

/* 共有ページの持ち主向け操作 */
.owner-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.owner-box h2 { margin: 0; font-size: 15px; }
