/* Town Of Host_L のサイト。紺の帯と白い地の落ち着いた作り。暗い色にも切り替えられる */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --card2: #f7f9fc;
  --line: #e1e6ee;
  --ink: #142033;
  --sub: #4f5d73;
  --dim: #8592a6;
  --acc: #1859c9;
  --acc-ink: #ffffff;
  --acc-soft: #e8f0fd;
  --navy: #0d1b2e;
  --navy2: #13294a;
  --ok: #17864a;
  --bad: #c8334a;
  --warn: #c99700;
  --shadow: 0 1px 2px rgba(16, 30, 54, .05);
  --font: "Segoe UI", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f141c;
  --card: #161d28;
  --card2: #1b2330;
  --line: #273243;
  --ink: #e5eaf2;
  --sub: #a4b0c2;
  --dim: #6d7a8f;
  --acc: #5b9bff;
  --acc-ink: #0b1220;
  --acc-soft: #172a47;
  --navy: #0a1019;
  --navy2: #0f1a2c;
  --ok: #5fd08d;
  --bad: #ff7a8c;
  --warn: #f2c94c;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; overflow-x: clip; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 14px/1.75 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--acc); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- 上の帯 ---- */
.nav { background: var(--navy); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.nav-in { max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; }
.logo img { height: 46px; display: block; }
.nav nav { display: flex; height: 100%; }
.nav nav a { display: flex; align-items: center; padding: 0 14px; color: #aab6c8; text-decoration: none; font-size: 13.5px; position: relative; }
.nav nav a:hover { color: #fff; }
.nav nav a.on { color: #fff; }
.nav nav a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: #5b9bff; }
.nav-dl { margin-left: auto; }
.nav .btn.main { background: #2f6fe0; border-color: #2f6fe0; color: #fff; }
.theme { width: 34px; height: 34px; border-radius: 6px; border: 1px solid #2a3a55; background: transparent; cursor: pointer; position: relative; }
.theme:hover { border-color: #4a5f82; }
.theme span { position: absolute; inset: 0; margin: auto; }
.theme .sun { width: 10px; height: 10px; border-radius: 50%; background: #e8edf5; box-shadow: 0 0 0 3px rgba(232, 237, 245, .18); }
.theme .moon { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset -4px -2px 0 0 #e8edf5; display: none; }
[data-theme="dark"] .theme .sun { display: none; }
[data-theme="dark"] .theme .moon { display: block; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 40px 24px 64px; }

/* ---- 下の帯 ---- */
.foot { background: var(--navy); color: #95a3b8; font-size: 13px; }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 40px 24px 28px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-brand img { height: 64px; display: block; margin-bottom: 10px; }
.foot-brand p { margin: 0; }
.foot h4 { margin: 0 0 10px; color: #e6ecf5; font-size: 13px; font-weight: 600; }
.foot a { display: block; color: #95a3b8; text-decoration: none; line-height: 2; }
.foot a:hover { color: #fff; }
.foot-bottom { max-width: 1200px; margin: 0 auto; padding: 16px 24px 24px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #6f7d93; }

/* ---- 部品 ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 5px 14px; cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn.main { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.main:hover { filter: brightness(1.08); color: var(--acc-ink); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn.ghost:hover { border-color: #fff; color: #fff; }
.btn.lg { padding: 11px 24px; font-size: 14px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.field { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.field:focus { outline: 3px solid var(--acc-soft); border-color: var(--acc); }
.note { color: var(--dim); font-size: 12px; font-weight: 400; }
.empty { color: var(--dim); padding: 32px; text-align: center; }
.warn { padding: 12px 16px; border-left: 3px solid var(--warn); margin: 0 0 16px; color: var(--sub); }

.eyebrow { margin: 0 0 6px; color: var(--acc); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.ptitle { margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ptitle h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.ptitle p:last-child { margin: 8px 0 0; color: var(--sub); }

/* ---- トップ ---- */
#page-home { margin-top: -40px; }
.hero, .stats { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy2) 100%); color: #fff; padding: 80px max(24px, calc(50vw - 576px)) 72px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero .eyebrow { color: #7fb0ff; }
.hero h1 { margin: 0; font-size: 32px; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.45; font-weight: 700; letter-spacing: .01em; }
.hero-sub { color: #b9c5d8; margin: 18px 0 28px; max-width: 560px; font-size: 15px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn.main { background: #2f6fe0; border-color: #2f6fe0; color: #fff; }
.hero-ver { margin: 18px 0 0; font-size: 12px; color: #7d8ba2; }
.hero-logo { width: 100%; max-width: 460px; justify-self: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 max(0px, calc(50vw - 600px)); background: var(--card); border-bottom: 1px solid var(--line); }
.stats div { padding: 24px 16px; text-align: center; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats b { display: block; font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats span { color: var(--sub); font-size: 12.5px; }
.section { padding: 56px 0 8px; }
.section h2 { margin: 0 0 24px; font-size: 24px; font-weight: 700; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat { padding: 24px 24px 20px; }
.fic { display: inline-block; font: 700 13px var(--mono); color: var(--acc); border: 1px solid var(--acc); border-radius: 4px; padding: 0 8px; }
.feat h3 { margin: 14px 0 6px; font-size: 16px; }
.feat p { margin: 0; color: var(--sub); font-size: 13.5px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card.go { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: border-color .12s; }
.card.go:hover { border-color: var(--acc); }
.card.go b { font-size: 15px; }
.card.go small { grid-row: 2; color: var(--dim); font-size: 12.5px; }
.card.go .arrow { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--acc); font-size: 18px; }

/* ---- 役職一覧 ---- */
.filter { padding: 18px 20px; margin-bottom: 28px; display: flex; flex-direction: column; gap: 12px; }
.filter .search { width: 100%; padding: 9px 14px; }
.frow { display: flex; gap: 14px; align-items: flex-start; }
.flabel { flex: none; width: 56px; color: var(--sub); font-size: 12px; font-weight: 700; padding-top: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 4px; padding: 2px 10px; cursor: pointer; font-size: 12.5px; color: var(--sub); }
.pill:hover { color: var(--ink); border-color: var(--dim); }
.pill.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.pill i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.pill b { font-weight: 400; opacity: .65; margin-left: 6px; font-size: 11.5px; }
.fcount { color: var(--sub); font-size: 12px; text-align: right; border-top: 1px solid var(--line); padding-top: 10px; }
.fcount b { color: var(--ink); font-size: 14px; }

.tgroup { margin: 32px 0 12px; display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 16px; padding-left: 12px; border-left: 3px solid var(--tc); line-height: 1.3; }
.tgroup:first-child { margin-top: 0; }
.tgroup small { color: var(--dim); font-weight: 400; font-size: 12px; }
.rgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.rcard:hover { border-color: var(--rc); box-shadow: 0 2px 10px rgba(16, 30, 54, .08); }
.hex { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: var(--rc); font-weight: 700; font-size: 17px; color: var(--hc); }
.rcard .t { min-width: 0; display: flex; flex-direction: column; }
.rcard .nm { font-weight: 700; font-size: 14px; line-height: 1.4; padding-bottom: 1px; border-bottom: 2px solid var(--rc); align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .sm { color: var(--dim); font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 役職の説明 (重ねて出す) ---- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 26, .55); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.mbox { background: var(--card); border-radius: 10px; width: min(680px, 100%); box-shadow: 0 24px 64px rgba(0, 0, 0, .3); overflow: hidden; }
.mhead { display: flex; gap: 16px; align-items: center; padding: 24px 28px 18px; border-top: 4px solid var(--rc); border-bottom: 1px solid var(--line); }
.mhead .hex { width: 60px; height: 60px; font-size: 24px; border-radius: 10px; }
.mhead h2 { margin: 0; font-size: 21px; line-height: 1.3; }
.mhead .en { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: 11.5px; font-weight: 600; border-radius: 4px; padding: 0 8px; background: var(--card2); border: 1px solid var(--line); color: var(--sub); }
.badge.team { color: #fff; border-color: transparent; background: var(--tc); }
.mbody { padding: 18px 28px 8px; }
.mbody .summary { margin: 0 0 6px; padding: 10px 14px; border-left: 3px solid var(--rc); background: var(--card2); font-weight: 600; }
.mbody h3 { font-size: 12px; margin: 20px 0 6px; color: var(--sub); letter-spacing: .08em; }
.mbody .long { white-space: pre-wrap; margin: 0; }
.mbody table { border-collapse: collapse; width: 100%; font-size: 13px; }
.mbody td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mbody td:last-child { color: var(--sub); white-space: nowrap; text-align: right; }
.mbody .sub td:first-child { color: var(--sub); }
.mfoot { display: flex; justify-content: space-between; gap: 8px; padding: 16px 28px 22px; }

/* ---- プリセット ---- */
#page-preset { padding-bottom: 72px; }
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font-size: 14px; }
.steps span { color: var(--sub); font-size: 12.5px; line-height: 1.6; }
.steps strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }

.pbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin-bottom: 16px; }
.pname { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--sub); font-weight: 600; }
.pname select { min-width: 220px; font-size: 15px; font-weight: 700; color: var(--ink); padding: 7px 10px; }
.pbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

.preset { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.ptabs { display: flex; flex-direction: column; padding: 6px; position: sticky; top: 80px; }
.ptabs button { text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; line-height: 1.35; }
.ptabs button + button { margin-top: 2px; }
.ptabs .tn { font-weight: 700; font-size: 14px; color: var(--ink); }
.ptabs small { font-size: 11.5px; color: var(--dim); }
.ptabs button:hover { background: var(--card2); }
.ptabs button.on { background: var(--acc-soft); }
.ptabs button.on .tn { color: var(--acc); }

.pmain { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ptool { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ptool input { flex: 1; min-width: 220px; padding: 10px 14px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--sub); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--acc); color: var(--acc-ink); }

/* 設定のまとまり */
.sec { overflow: hidden; }
.sec-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: none; border: 0; cursor: pointer; text-align: left; font-weight: 700; font-size: 15px; color: var(--ink); }
.sec-h:hover { background: var(--card2); }
.sec-h.static { cursor: default; }
.sec-h.static:hover { background: none; }
.sec-t { flex: 1; }
.sec-n { font-size: 12px; font-weight: 600; color: var(--dim); }
.sec-a { font-size: 12px; font-weight: 600; color: var(--acc); min-width: 40px; text-align: right; }
.sec-a::after { content: " ▾"; }
.sec.open .sec-a::after { content: " ▴"; }
.sec.open .sec-h { border-bottom: 1px solid var(--line); }
.rows { display: flex; flex-direction: column; }

/* 設定の 1 行 */
.orow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-height: 56px; position: relative; }
.rows > .orow:last-child, .kids > .orow:last-child { border-bottom: 0; }
.orow.head .nm { font-weight: 700; color: var(--sub); font-size: 12.5px; }
.orow .name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.orow .nm { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.5; }
.tag { font-size: 10.5px; font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: 3px; padding: 0 6px; line-height: 1.7; }
.orow .crumb { color: var(--dim); font-size: 11.5px; }
.desc { margin: 0; color: var(--sub); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.desc.full { display: block; }
.desc:not(.full):hover { color: var(--ink); }
.hint { color: var(--dim); font-size: 11.5px; }
.hint::before { content: "↳ "; }
.orow.off { opacity: .6; }
.orow .right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.orow.changed { box-shadow: inset 3px 0 0 var(--acc); }
.kids { margin: 0 0 0 20px; border-left: 2px solid var(--acc-soft); background: var(--card2); border-bottom: 1px solid var(--line); }
.kids .orow { min-height: 48px; padding: 10px 20px 10px 18px; }
.kids .orow .nm { font-size: 13.5px; font-weight: 500; }
.kids .kids { margin-left: 18px; background: var(--card); }
.reset { background: none; border: 0; color: var(--acc); cursor: pointer; font-size: 12px; font-weight: 600; padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.reset:hover { filter: brightness(1.2); }
.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 30% { background: var(--acc-soft); box-shadow: 0 0 0 2px var(--acc); } }

/* 全般の目次 */
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; position: sticky; top: 72px; z-index: 5; box-shadow: var(--shadow); }
.toc-l { white-space: nowrap; font-size: 12px; color: var(--dim); font-weight: 700; margin-right: 2px; }
.toc button { border: 1px solid var(--line); background: var(--card2); border-radius: 4px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--sub); white-space: nowrap; }
.toc button:hover { color: var(--acc); border-color: var(--acc); }
.toc b { margin-left: 6px; background: var(--acc); color: var(--acc-ink); border-radius: 3px; padding: 0 5px; font-size: 11px; }
.sec { scroll-margin-top: 140px; }
.sec.flat .sec-h { padding: 16px 20px 12px; font-size: 16px; }
.sec.flat .sec-t::before { content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: var(--acc); margin-right: 10px; vertical-align: -2px; }

/* 値の部品 */
.ctl { display: flex; align-items: center; gap: 8px; }
.fixed { color: var(--sub); font-size: 13px; padding: 0 6px; }
.sw { position: relative; width: 44px; height: 24px; flex: none; }
.sw input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 12px; background: #c3cad6; pointer-events: none; transition: background .12s; }
[data-theme="dark"] .sw span { background: #3a4558; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .12s; }
.sw input:checked + span { background: var(--acc); }
.sw input:checked + span::after { left: 23px; }
.sw input:focus-visible + span { outline: 3px solid var(--acc-soft); }
.sw.big { width: 52px; height: 28px; }
.sw.big span { border-radius: 14px; }
.sw.big span::after { width: 22px; height: 22px; }
.sw.big input:checked + span::after { left: 27px; }
.swt { font-size: 12.5px; color: var(--sub); min-width: 26px; }
.step { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.sb { width: 34px; border: 0; background: var(--card2); cursor: pointer; font-size: 17px; font-weight: 600; color: var(--ink); }
.sb:hover:not(:disabled) { background: var(--acc-soft); color: var(--acc); }
.sb:disabled { color: var(--line); cursor: default; }
.sv { position: relative; min-width: 96px; max-width: 220px; padding: 5px 10px; text-align: center; font-weight: 700; font-size: 13.5px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv:hover { color: var(--acc); }
.sv select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 14px; }

/* 役職のカード */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; border-top: 3px solid var(--line); transition: border-color .12s, box-shadow .12s; }
.pcard.used { border-top-color: var(--rc); box-shadow: 0 2px 12px rgba(16, 30, 54, .08); }
.pc-top { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px; }
.pc-top .hex { width: 40px; height: 40px; font-size: 16px; }
.pcard:not(.used) .hex { opacity: .55; }
.pc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.pc-t b { font-size: 15px; }
.pc-t small { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-use { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--sub); font-weight: 600; }
.pc-body { padding: 4px 14px 6px; display: flex; flex-direction: column; gap: 8px; }
.pc-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--sub); }
.pc-line .sv { min-width: 72px; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px 12px; margin-top: auto; }
.pc-ch { font-size: 12px; color: var(--acc); font-weight: 600; }
.btn.quiet { color: var(--sub); }
.btn.small { padding: 1px 8px; font-size: 11.5px; }

/* 下に残る帯 */
.pfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 30, 54, .08); }
.pfoot-in { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; }
.pchg { display: flex; align-items: baseline; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px; cursor: pointer; color: var(--ink); }
.pchg b { font-size: 20px; color: var(--acc); line-height: 1; }
.pchg span { font-size: 13px; font-weight: 600; }
.pchg:hover { border-color: var(--acc); }
.pchg.zero b { color: var(--dim); }
.pfoot .saved { color: var(--dim); font-size: 12px; transition: color .3s; }
.pfoot .saved.just { color: var(--ok); }
.pfoot .btn.lg { margin-left: auto; padding: 11px 32px; font-size: 15px; }

/* 横から出る窓 */
.drawer-bg { position: fixed; inset: 0; z-index: 40; background: rgba(8, 14, 26, .45); animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(560px, 100%); background: var(--card); display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0, 0, 0, .25); animation: slide .18s ease-out; border-top: 4px solid var(--rc, var(--acc)); }
@keyframes slide { from { transform: translateX(40px); opacity: .5; } }
.dhead { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.dt b { font-size: 18px; }
.dt small { color: var(--dim); font-size: 12px; }
.dbody { flex: 1; overflow-y: auto; }
.dbody .orow { padding-right: 20px; }
.dinfo { margin: 12px 20px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: var(--card2); }
.dinfo summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--acc); }
.dinfo p { white-space: pre-wrap; margin: 8px 0 0; font-size: 13px; }
.dfoot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.dgroup { margin: 0; padding: 12px 20px 6px; font-size: 12px; color: var(--sub); letter-spacing: .04em; }
.chg { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.chg-n { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font-size: 13.5px; overflow-wrap: anywhere; }
.chg-n:hover { color: var(--acc); text-decoration: underline; }
.chg-v { font-weight: 700; font-size: 13px; color: var(--acc); white-space: nowrap; }
.note.pad { padding: 8px 20px; margin: 0; }
.xclose { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); font-size: 20px; line-height: 1; cursor: pointer; color: var(--sub); flex: none; }
.xclose:hover { color: var(--ink); border-color: var(--dim); }

/* ゲームに入れる・読み込む */
.xbox { width: min(620px, 100%); }
.xhead { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.xhead h2 { margin: 0; font-size: 18px; }
.xbody { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.xbody p { margin: 0; }
.xstep { display: flex; gap: 14px; }
.xstep > b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font-size: 14px; }
.xstep > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.xstep h3 { margin: 3px 0 0; font-size: 15px; }
.xcode { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; max-height: 96px; overflow-y: auto; }
.xcode code { font: 12px/1.5 var(--mono); word-break: break-all; color: var(--sub); }
.xbody .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.xmore { border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--sub); }
.xmore summary { cursor: pointer; font-weight: 600; }
.xmore p { margin: 8px 0; }
.xmore code { font-family: var(--mono); }
.xbody textarea { width: 100%; height: 110px; resize: vertical; font: 12px/1.5 var(--mono); word-break: break-all; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.msg { font-size: 13px; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }

@media (max-width: 1100px) {
  .rgrid { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 48px 24px; }
  .stats { padding: 0; }
  .hero-logo { display: none; }
  .hero h1 { font-size: 26px; }
  .feats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-in { gap: 8px; padding: 0 12px; }
  .logo img { height: 36px; }
  .nav nav a { padding: 0 7px; font-size: 12.5px; }
  .nav nav a[target] { display: none; }
  .nav-dl { display: none; }
  .theme { margin-left: auto; }
  .rgrid { grid-template-columns: repeat(2, 1fr); }
  .preset { grid-template-columns: 1fr; }
  .ptabs { position: static; flex-direction: row; overflow-x: auto; }
  .ptabs button { flex: none; }
  .pbtns { margin-left: 0; }
  .pfoot-in { padding: 8px 12px; gap: 10px; }
  .pfoot .saved { display: none; }
  .pfoot .btn.lg { padding: 10px 18px; }
  main { padding: 24px 14px 48px; }
  #page-home { margin-top: -24px; }
  .ptitle { margin-bottom: 18px; padding-bottom: 14px; }
  .ptitle h1 { font-size: 23px; }
  .steps { gap: 6px; margin-bottom: 14px; }
  .steps li { padding: 10px 12px; }
  .pbar { padding: 12px; }
  .pname { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  .pname select { min-width: 0; width: 100%; }
  .pbtns { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .pbtns .btn { white-space: normal; padding: 8px 6px; }
  .ptabs { position: sticky; top: 64px; z-index: 6; padding: 4px; gap: 4px; scrollbar-width: none; }
  .ptabs button { padding: 6px 10px; }
  .ptabs small { display: none; }
  .ptool input { min-width: 0; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .toc { position: static; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filter .pill { flex: none; }
  .sec { scroll-margin-top: 120px; }
  .orow { padding: 12px 14px; gap: 8px 12px; }
  .orow.has-step { grid-template-columns: 1fr; }
  .orow.has-step .right { justify-content: flex-start; }
  .orow.has-step .right, .orow.has-step .ctl, .orow.has-step .step { width: 100%; }
  .orow.has-step .sv { flex: 1; max-width: none; }
  .kids { margin-left: 10px; }
  .kids .orow { padding: 10px 12px; }
  .kids .kids { margin-left: 8px; }
  .sb { width: 44px; }
  .pgrid { grid-template-columns: 1fr; }
  .pc-top { padding: 12px 12px 8px; }
  .drawer { width: 100%; border-radius: 0; }
  .dhead { padding: 14px; }
  .dfoot { padding: 12px 14px; }
  .xhead, .xbody { padding-left: 16px; padding-right: 16px; }
  .modal { padding: 0; align-items: flex-end; }
  .mbox { border-radius: 14px 14px 0 0; max-height: 92vh; overflow-y: auto; }
  .hero-cta .btn { flex: 1; }
  .filter { padding: 14px; }
  .mhead { padding: 18px 16px 14px; }
  .mbody, .mfoot { padding-left: 16px; padding-right: 16px; }
  .frow { flex-direction: column; gap: 4px; }
}
@media (max-width: 480px) {
  .logo { display: none; }
  .rgrid, .cards { grid-template-columns: 1fr; }
}

/* ---- タブの絵 ---- */
.ptabs button { flex-direction: row; align-items: center; gap: 10px; }
.ptabs .ti { width: 34px; height: 34px; flex: none; object-fit: contain; }
.ptabs .tt { display: flex; flex-direction: column; min-width: 0; }

/* ---- スポーンのピン ---- */
.spawn { margin: 8px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card2); }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sp-t { display: flex; flex-direction: column; }
.sp-t small { color: var(--dim); font-size: 12px; }
.sp-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-help { font-size: 12.5px; color: var(--sub); margin: 8px 0; }
.sp-help.warn { color: var(--bad); }
.sp-help.pad { padding: 4px 16px 12px; margin: 0; }
.sp-stage { position: relative; width: 100%; background: #0d1626; border-radius: 6px; overflow: hidden; cursor: crosshair; user-select: none; touch-action: none; }
.sp-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; border: 2px solid #111; background: var(--pc); color: #111; font: 700 10.5px/1 system-ui, sans-serif; padding: 0; display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); touch-action: none; }
.pin.off { opacity: .45; border-style: dashed; }
.pin.sel { outline: 3px solid #fff; outline-offset: 1px; z-index: 2; }
.pin.static { position: static; transform: none; flex: none; cursor: default; }
.sp-tip { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(0, 0, 0, .78); color: #fff; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.sp-tip.on { opacity: 1; }
.sp-edit { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.sp-edit .pin.static { margin-bottom: 6px; }
.sp-f { display: flex; flex-direction: column; gap: 2px; }
.sp-f small { font-size: 11.5px; color: var(--dim); }
.sp-f input, .sp-f select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.sp-f input { width: 150px; }
.sp-btns { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.sp-intro { padding: 16px 18px; margin-bottom: 12px; }
.sp-intro p { margin: 6px 0 10px; font-size: 13.5px; color: var(--sub); }
.sp-sec { display: flex; align-items: center; gap: 10px; }
.sp-thumb { width: 64px; height: 38px; object-fit: contain; background: #0d1626; border-radius: 4px; flex: none; }
@media (max-width: 760px) {
  .ptabs .ti { width: 26px; height: 26px; }
  .ptabs button { gap: 6px; }
  .spawn { padding: 10px; margin-left: -6px; margin-right: -6px; }
  .pin { width: 20px; height: 20px; font-size: 9.5px; }
  .sp-btns { margin-left: 0; width: 100%; }
  .sp-btns .btn { flex: 1; }
  .sp-f { flex: 1; }
  .sp-f input { width: 100%; }
  .sp-thumb { display: none; }
}
