/* キャラクターシート（印刷・画像出力用）。サイトのテーマ（ライト／ダーク・アクセント色）に合わせて色が変わる */
.sheet-root {
  --s-bg: #ffffff; --s-ink: #1b1d24; --s-muted: #5f6573; --s-line: #2a2d36; --s-soft: #d9dce3; --s-fill: #f4f5f8; --s-faint: #a3a8b3;
  --s-accent: #8f2328; --s-brass: #7d6020;
  color: var(--s-ink); font-family: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", sans-serif; font-size: 11.5px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 16px; width: 794px; color-scheme: light;
}
:root[data-theme="dark"] .sheet-root {
  --s-accent: #e0666c; --s-bg: #16181e; --s-ink: #eceef3; --s-muted: #a4aab7; --s-line: #b9bdc8; --s-soft: #3a3e49; --s-fill: #23262e; --s-faint: #6c7280; --s-brass: #d3b265; color-scheme: dark;
}
.sheet-page { background: var(--s-bg); width: 794px; min-height: 1123px; padding: 30px 32px 26px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.12); position: relative; }
.sheet-root .sh-empty { color: var(--s-faint); }
.sh-head { display: grid; grid-template-columns: 112px 1fr; gap: 14px; border-bottom: 3px double var(--s-line); padding-bottom: 10px; }
.sh-portrait { width: 112px; height: 140px; object-fit: cover; border: 1px solid var(--s-line); border-radius: 4px; background: var(--s-fill); }
.sh-noimg { display: grid; place-items: center; color: var(--s-faint); font-size: 10px; letter-spacing: .1em; }
.sh-name { font-family: "Shippori Mincho B1", serif; font-weight: 800; font-size: 26px; line-height: 1.2; border-bottom: 1px solid var(--s-line); padding-bottom: 2px; }
.sh-name-lab { font-size: 9px; color: var(--s-muted); margin-bottom: 6px; }
.sh-headgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; }
.sh-field { min-width: 0; }
.sh-val { border-bottom: 1px solid var(--s-soft); min-height: 18px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-lab { font-size: 9px; color: var(--s-muted); }
.sh-main { display: grid; grid-template-columns: 92px 170px 1fr 1fr; gap: 10px; flex: 1; }
.sh-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sh-abs { display: flex; flex-direction: column; gap: 8px; }
.sh-ab { border: 1.5px solid var(--s-line); border-radius: 8px; text-align: center; padding: 4px 2px 6px; position: relative; background: var(--s-bg); }
.sh-ab-name { font-size: 11px; font-weight: 700; }
.sh-ab-name small { display: block; font-size: 8px; color: var(--s-muted); letter-spacing: .1em; font-family: "Cinzel", serif; }
.sh-ab-mod { font-family: "Shippori Mincho B1", serif; font-size: 26px; font-weight: 800; line-height: 1.1; }
.sh-ab-score { display: inline-block; min-width: 38px; border: 1px solid var(--s-line); border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--s-fill); }
.sh-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--s-line); border-radius: 999px; padding: 2px 10px 2px 2px; }
.sh-pill b { display: grid; place-items: center; min-width: 30px; height: 26px; border: 1px solid var(--s-line); border-radius: 999px; font-size: 13px; background: var(--s-fill); }
.sh-pill span { font-size: 10px; }
.sh-box { border: 1px solid var(--s-line); border-radius: 6px; padding: 6px 8px 8px; min-width: 0; background: var(--s-bg); }
.sh-box h3 { margin: 0 0 4px; font-size: 10px; letter-spacing: .12em; text-align: center; color: var(--s-ink); font-weight: 700; border-bottom: 1px solid var(--s-soft); padding-bottom: 3px; }
.sh-grow { flex: 1; }
.sh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.sh-list li { display: grid; grid-template-columns: 12px 26px 1fr; gap: 3px; align-items: center; font-size: 11px; }
.sh-list li b { text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--s-soft); }
.sh-list li small { color: var(--s-muted); font-size: 9px; margin-left: 2px; }
.sh-prof { font-size: 9px; color: var(--s-ink); text-align: center; }
.sh-prof.off { color: var(--s-faint); }
.sh-prof.ex { color: var(--s-accent); }
.sh-sm { font-size: 9.5px; color: var(--s-muted); }
.sh-center { text-align: center; }
.sh-combat { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.sh-shield, .sh-stat { border: 1.5px solid var(--s-line); text-align: center; padding: 4px 2px; display: flex; flex-direction: column; justify-content: center; }
.sh-shield { border-radius: 6px 6px 50% 50% / 6px 6px 22% 22%; }
.sh-stat { border-radius: 6px; }
.sh-shield b, .sh-stat b { font-family: "Shippori Mincho B1", serif; font-size: 24px; font-weight: 800; line-height: 1.15; }
.sh-stat b small { font-size: 11px; }
.sh-shield span, .sh-stat span { font-size: 9px; color: var(--s-muted); }
.sh-hp { display: flex; flex-direction: column; gap: 4px; }
.sh-hp-max { font-size: 10px; color: var(--s-muted); border-bottom: 1px solid var(--s-soft); }
.sh-hp-max b { color: var(--s-ink); font-size: 13px; }
.sh-hp-cur { text-align: center; }
.sh-hp-cur b { display: block; font-family: "Shippori Mincho B1", serif; font-size: 30px; font-weight: 800; line-height: 1.1; }
.sh-hp-cur span, .sh-hp-row span { font-size: 9px; color: var(--s-muted); }
.sh-hp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: center; }
.sh-hp-row > div { border: 1px solid var(--s-soft); border-radius: 4px; padding: 2px; }
.sh-hp-row b { display: block; font-size: 14px; }
.sh-death { display: flex; justify-content: space-between; gap: 6px; font-size: 9.5px; align-items: center; flex-wrap: wrap; }
.sh-pip { display: inline-block; width: 9px; height: 9px; border: 1px solid var(--s-line); border-radius: 50%; margin-left: 2px; vertical-align: -1px; }
.sh-pip.on { background: var(--s-ink); }
.sh-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.sh-table th { white-space: nowrap; font-size: 9px; color: var(--s-muted); font-weight: 400; text-align: left; border-bottom: 1px solid var(--s-line); padding: 2px 3px; }
.sh-table td { border-bottom: 1px solid var(--s-soft); padding: 3px; vertical-align: top; }
.sh-table td.num { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-table td.sm { font-size: 9px; color: var(--s-muted); }
.sh-res { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.sh-res li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--s-soft); font-size: 10.5px; }
.sh-rolls { font-size: 10px; color: var(--s-muted); margin-top: 4px; }
.sh-text { font-size: 11px; white-space: normal; word-break: break-word; }
.sh-foot { margin-top: auto; text-align: right; font-size: 9px; color: var(--s-faint); letter-spacing: .05em; }
.sh-p2head { display: flex; align-items: baseline; gap: 12px; border-bottom: 3px double var(--s-line); padding-bottom: 6px; }
.sh-p2head span { font-family: "Shippori Mincho B1", serif; font-weight: 800; font-size: 20px; }
.sh-p2head small { color: var(--s-muted); }
.sh-spellhead { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.sh-spells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-spl { border: 1px solid var(--s-soft); border-radius: 5px; padding: 4px 6px; }
.sh-spl-h { display: flex; justify-content: space-between; border-bottom: 1px solid var(--s-line); margin-bottom: 3px; }
.sh-spl-h b { font-size: 11px; }
.sh-spl-h span { font-size: 9.5px; color: var(--s-muted); }
.sh-spl ul { list-style: none; margin: 0; padding: 0; }
.sh-spl li { font-size: 10.5px; border-bottom: 1px dotted var(--s-soft); padding: 1px 0; }
.sh-spdesc { font-size: 9.5px; color: var(--s-muted); line-height: 1.4; padding: 1px 0 2px 14px; white-space: normal; }
.sh-prep { color: var(--s-faint); margin-right: 3px; }
.sh-prep.on { color: var(--s-accent); }
.sh-two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
.sh-stack { display: flex; flex-direction: column; gap: 8px; }
.sh-coins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.sh-coins div { border: 1px solid var(--s-soft); border-radius: 4px; text-align: center; padding: 2px; }
.sh-coins b { display: block; font-size: 13px; }
.sh-coins span { font-size: 9px; color: var(--s-muted); }
.sh-res { grid-template-columns: 1fr; }
.sh-res li { align-items: center; gap: 6px; padding: 2px 0; }
.sh-res-name { flex: 1; min-width: 0; }
.sh-boxes { display: inline-flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; max-width: 60%; }
.sh-box-c { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--s-line); border-radius: 2px; background: var(--s-bg); vertical-align: -1px; }
.sh-write { color: var(--s-muted); font-size: 10px; }
.sh-spl-h span .sh-boxes { margin-left: 4px; }
.sh-spellhead + .sh-spellhead { border-top: 1px dotted var(--s-soft); padding-top: 4px; }

/* アクセント色 */
.sh-head { border-bottom-color: var(--s-accent); }
.sh-p2head { border-bottom-color: var(--s-accent); }
.sh-box h3 { color: var(--s-accent); border-bottom-color: var(--s-accent); }
.sh-name { border-bottom-color: var(--s-accent); }
.sh-ab { border-color: var(--s-accent); }
.sh-ab-name small, .sh-ab-score { color: var(--s-ink); }
.sh-shield { border-color: var(--s-accent); }
.sh-shield b, .sh-hp-cur b { color: var(--s-accent); }
.sh-spl-h { border-bottom-color: var(--s-accent); }
.sh-pip.on { background: var(--s-ink); }

/* パステル（背景色のみ変わる。文字は黒） */
:root[data-theme="pastel-sakura"] .sheet-root { --s-bg: #fbedf2; --s-fill: #f8e4eb; --s-soft: #cfbbc2; }
:root[data-theme="pastel-peach"] .sheet-root { --s-bg: #fdf1e8; --s-fill: #fce9dc; --s-soft: #d3c0b4; }
:root[data-theme="pastel-lemon"] .sheet-root { --s-bg: #fbf7e1; --s-fill: #f9f2d0; --s-soft: #d0caa8; }
:root[data-theme="pastel-mint"] .sheet-root { --s-bg: #eaf7ee; --s-fill: #dff2e6; --s-soft: #b6cabd; }
:root[data-theme="pastel-sky"] .sheet-root { --s-bg: #ebf3fb; --s-fill: #e0edf9; --s-soft: #b8c5d0; }
:root[data-theme="pastel-lavender"] .sheet-root { --s-bg: #f1edfa; --s-fill: #eae3f6; --s-soft: #c1bace; }
:root[data-theme="pastel-aqua"] .sheet-root { --s-bg: #e8f6f6; --s-fill: #dbf1f1; --s-soft: #b3c9c8; }
:root[data-theme="pastel-sand"] .sheet-root { --s-bg: #f6f1e8; --s-fill: #f1eadc; --s-soft: #c9c1b4; }
