/* 中国史勢力図エンジン（戦国勢力図のスタイルを一般化。作品ごとの配色・年表は末尾で html のクラスごとに上書き）
   戦国勢力図 — style
   ================================================================ */
:root {
  --bg: #101319;
  --bg-grad: radial-gradient(1200px 800px at 30% 20%, #18202c 0%, #101319 60%);
  --surface: #161a22;
  --surface-2: #1d222c;
  --surface-3: #252b37;
  --line: #2c3340;
  --line-soft: #232935;
  --text: #ece5d3;
  --text-2: #c9c1ae;
  --muted: #8f8a7e;
  --accent: #d9a441;
  --accent-2: #e8c877;
  --danger: #d0543f;
  --sea-1: #13263a;
  --sea-2: #0b1624;
  --grat: rgba(160, 190, 220, .07);
  --ctx-land: #222b36;
  --ctx-line: #2d3845;
  --kuni-line: rgba(8, 10, 14, .45);
  --clan-line: rgba(10, 11, 14, .95);
  --land-opacity: .92;
  --label: #fff8e6;
  --label-halo: rgba(12, 14, 18, .88);
  --kuni-label: rgba(255, 248, 230, .72);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --radius: 12px;
  --font-serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  --t-battle: #e0674f;
  --t-politics: #d9a441;
  --t-culture: #6fbf8a;
  --t-foreign: #6ea8e0;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #efe7d6;
  --bg-grad: radial-gradient(1200px 800px at 30% 20%, #f6f0e2 0%, #ebe1cc 70%);
  --surface: #f7f1e3;
  --surface-2: #efe6d3;
  --surface-3: #e5dac3;
  --line: #d3c6ab;
  --line-soft: #e0d5bd;
  --text: #2a2419;
  --text-2: #4a4131;
  --muted: #7a705e;
  --accent: #a3321f;
  --accent-2: #c0552f;
  --sea-1: #c9d6d6;
  --sea-2: #b3c4c6;
  --grat: rgba(40, 60, 70, .08);
  --ctx-land: #ddd3bd;
  --ctx-line: #c9bda3;
  --kuni-line: rgba(40, 30, 20, .35);
  --clan-line: rgba(35, 26, 16, .9);
  --land-opacity: .86;
  --label: #1c1710;
  --label-halo: rgba(250, 245, 233, .9);
  --kuni-label: rgba(40, 32, 20, .72);
  --shadow: 0 12px 36px rgba(60, 45, 20, .22);
  --t-battle: #b8412c;
  --t-politics: #9c6d12;
  --t-culture: #3d8a57;
  --t-foreign: #2f6ea8;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #efe7d6;
    --bg-grad: radial-gradient(1200px 800px at 30% 20%, #f6f0e2 0%, #ebe1cc 70%);
    --surface: #f7f1e3;
    --surface-2: #efe6d3;
    --surface-3: #e5dac3;
    --line: #d3c6ab;
    --line-soft: #e0d5bd;
    --text: #2a2419;
    --text-2: #4a4131;
    --muted: #7a705e;
    --accent: #a3321f;
    --accent-2: #c0552f;
    --sea-1: #c9d6d6;
    --sea-2: #b3c4c6;
    --grat: rgba(40, 60, 70, .08);
    --ctx-land: #ddd3bd;
    --ctx-line: #c9bda3;
    --kuni-line: rgba(40, 30, 20, .35);
    --clan-line: rgba(35, 26, 16, .9);
    --land-opacity: .86;
    --label: #1c1710;
    --label-halo: rgba(250, 245, 233, .9);
    --kuni-label: rgba(40, 32, 20, .72);
    --shadow: 0 12px 36px rgba(60, 45, 20, .22);
    --t-battle: #b8412c;
    --t-politics: #9c6d12;
    --t-culture: #3d8a57;
    --t-foreign: #2f6ea8;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
:root[data-theme="light"] a { color: var(--accent); }
kbd {
  display: inline-block; padding: 0 .4em; margin: 0 .1em; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; font-size: .85em; background: var(--surface-2);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  height: 100dvh;
}

/* ── header ─────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: #b3282d; color: #f6ecd6;
  font-family: var(--font-serif); font-weight: 800; font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 2px 10px rgba(179,40,45,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-title { font-family: var(--font-serif); font-weight: 800; font-size: 22px; letter-spacing: .12em; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toggles { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.tg { position: relative; display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.tg input { position: absolute; opacity: 0; pointer-events: none; }
.toggles .tg span { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; color: var(--muted); transition: background .2s, color .2s; }
.toggles .tg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.toggles .tg input:focus-visible + span { outline: 2px solid var(--accent); }
.btn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; transition: background .2s, border-color .2s;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); }
.btn.icon { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-weight: 700; }
.btn .short { display: none; }

/* ── layout ─────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  min-height: 0;
}

/* ── map ────────────────────────────────── */
.map-wrap { position: relative; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map:active { cursor: grabbing; }
.sea { fill: url(#sea-grad); }
.grat { fill: none; stroke: var(--grat); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ctx-land { fill: var(--ctx-land); stroke: var(--ctx-line); stroke-width: .6; vector-effect: non-scaling-stroke; }
.ctx-name { font-family: var(--font-serif); fill: var(--muted); opacity: .55; letter-spacing: .5em; font-size: 20px; pointer-events: none; }
.region {
  fill-opacity: var(--land-opacity);
  stroke: var(--kuni-line); stroke-width: .7; vector-effect: non-scaling-stroke;
  transition: fill .55s ease, fill-opacity .35s ease, opacity .35s ease;
  cursor: pointer;
}
.region.dim { opacity: .22; }
.region.hover { fill-opacity: 1; }
.hover-outline { fill: none; stroke: var(--label); stroke-width: 1.8; vector-effect: non-scaling-stroke; pointer-events: none; }
.region.sel { fill-opacity: 1; }
.region.flash { animation: flash 1.3s ease-out; }
@keyframes flash {
  0% { fill-opacity: 1; filter: brightness(1.9) saturate(1.3); }
  100% { filter: none; }
}
.clan-border { fill: none; stroke: var(--clan-line); stroke-width: 2.1; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.sel-outline { fill: none; stroke: var(--accent-2); stroke-width: 2.6; vector-effect: non-scaling-stroke; pointer-events: none; filter: drop-shadow(0 0 4px rgba(0,0,0,.6)); }
.inset-frame { fill: color-mix(in srgb, var(--sea-2) 55%, transparent); stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.inset-title { font-size: 12px; fill: var(--muted); font-family: var(--font-serif); letter-spacing: .1em; }

.ov text { pointer-events: none; }
.clan-label {
  font-family: var(--font-serif); font-weight: 800; fill: var(--label);
  paint-order: stroke; stroke: var(--label-halo); stroke-width: 3.2px; stroke-linejoin: round;
  letter-spacing: .08em; text-anchor: middle; dominant-baseline: central;
  transition: opacity .3s;
}
.clan-label-hit { fill: transparent; cursor: pointer; pointer-events: all; }
.kuni-label {
  font-family: var(--font-serif); font-weight: 500; fill: var(--kuni-label);
  paint-order: stroke; stroke: var(--label-halo); stroke-width: 2.4px; stroke-opacity: .6;
  text-anchor: middle; dominant-baseline: central; letter-spacing: .05em;
}
.castle { cursor: pointer; }
.castle path { fill: var(--label); stroke: var(--label-halo); stroke-width: 1.2px; paint-order: stroke; }
.castle:hover path { fill: var(--accent-2); }
.ev { cursor: pointer; }
.ev circle.dot { stroke: var(--label-halo); stroke-width: 1.5px; }
.ev text { font-family: var(--font-serif); font-weight: 800; font-size: 10px; fill: #fff; text-anchor: middle; dominant-baseline: central; }
.ev .ring { fill: none; stroke-width: 2px; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ev.fresh .ring { animation: ring 1.8s ease-out infinite; }
.ev.has-anim circle.dot { stroke: #fff8e6; stroke-width: 2.5px; }
.ev.pinned circle.dot { stroke: var(--accent-2); stroke-width: 3px; }
/* Safari は r のアニメーションに非対応のため transform で拡大する */
@keyframes ring {
  0% { transform: scale(.3); opacity: .9; }
  100% { transform: scale(1); opacity: 0; }
}
.ripple { fill: none; stroke: var(--accent-2); stroke-width: 2px; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: ripple 1.4s ease-out forwards; }
@keyframes ripple {
  0% { transform: scale(.1); opacity: .95; }
  100% { transform: scale(1); opacity: 0; }
}

/* watermark */
.watermark { position: absolute; left: 22px; top: 14px; pointer-events: none; user-select: none; }
.wm-year {
  font-family: var(--font-serif); font-weight: 800; line-height: 1;
  font-size: clamp(44px, 6.4vw, 92px); letter-spacing: .02em;
  color: var(--text); opacity: .92; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px var(--label-halo);
}
.wm-sub { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-family: var(--font-serif); font-size: 16px; color: var(--text-2); }
.wm-era {
  font-size: 12.5px; padding: 2px 10px; border-radius: 999px;
  background: var(--era-color, var(--accent)); color: #fff8e6; letter-spacing: .1em;
}

/* map legend */
.map-legend {
  position: absolute; left: 18px; bottom: 16px; max-width: min(520px, 70%);
  display: flex; flex-wrap: wrap; gap: 6px;
}
.map-legend .chip { background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0,0,0,.2); }

.map-ctrl { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl button {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: 16px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.map-ctrl button:hover { border-color: var(--accent); }
#z-reset { font-family: var(--font-serif); font-size: 14px; }

.focus-bar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; white-space: nowrap;
}
.focus-bar button { border: 0; background: var(--surface-3); border-radius: 999px; padding: 2px 10px; }

.toast {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%);
  width: min(460px, calc(100% - 32px)); z-index: 6;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--t-color, var(--accent));
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow);
  animation: toastIn .35s ease-out;
}
.toast .t-date { font-size: 12px; color: var(--muted); }
.toast .t-title { font-family: var(--font-serif); font-weight: 800; font-size: 18px; margin: 2px 0 4px; }
.toast .t-desc { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 180px; max-width: 280px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--shadow); font-size: 12.5px;
}
.tooltip .tt-kuni { font-family: var(--font-serif); font-weight: 800; font-size: 16px; }
.tooltip .tt-sub { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.tooltip .tt-note { margin-top: 6px; color: var(--text-2); font-size: 12px; }
.tooltip .tt-hint { margin-top: 6px; color: var(--muted); font-size: 11px; }

/* ── chips / common ─────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; line-height: 1.6; white-space: nowrap; cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--c, var(--accent)); }
.chip i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.chip.hatch i, .sw.hatch { background: repeating-linear-gradient(45deg, #6f6a5f 0 3px, #9a948a 3px 5px); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.badge {
  display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 4px; line-height: 1.7;
  background: color-mix(in srgb, var(--b) 18%, transparent); color: var(--b); border: 1px solid color-mix(in srgb, var(--b) 45%, transparent);
  font-weight: 700; white-space: nowrap;
}
.t-battle { --b: var(--t-battle); }
.t-politics { --b: var(--t-politics); }
.t-culture { --b: var(--t-culture); }
.t-foreign { --b: var(--t-foreign); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── panel ──────────────────────────────── */
.panel {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--line-soft); background: color-mix(in srgb, var(--surface) 94%, transparent);
}
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line-soft); flex: none; }
.tabs button {
  border: 0; background: transparent; padding: 11px 0 10px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; font-family: var(--font-serif); font-weight: 700; letter-spacing: .15em;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }
.panel-body, .detail-body { overflow-y: auto; padding: 16px 18px 28px; min-height: 0; flex: 1; scrollbar-width: thin; }
.detail {
  position: absolute; inset: 0; background: var(--surface); display: flex; flex-direction: column;
  animation: slideIn .25s ease-out; z-index: 3;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-back { flex: none; align-self: flex-start; margin: 10px 12px 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 14px; font-size: 13px; }
.detail-back:hover { border-color: var(--accent); }

.sec { margin-bottom: 22px; }
.sec-title {
  font-family: var(--font-serif); font-weight: 800; font-size: 15px; letter-spacing: .12em;
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
}
.sec-title::before { content: ''; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.sec-title small { font-family: var(--font-sans); font-weight: 400; color: var(--muted); letter-spacing: 0; font-size: 12px; margin-left: auto; }

.era-box { border-radius: var(--radius); padding: 14px 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--era-color) 26%, var(--surface-2)), var(--surface-2)); border: 1px solid var(--line); }
.era-box .era-range { font-size: 12px; color: var(--muted); }
.era-box .era-name { font-family: var(--font-serif); font-weight: 800; font-size: 20px; letter-spacing: .1em; margin: 2px 0 6px; }
.era-box p { margin: 0; color: var(--text-2); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 10px 8px; }
.stat .v { font-family: var(--font-serif); font-weight: 800; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; margin-left: 2px; }
.stat .k { font-size: 11.5px; color: var(--muted); }

.sharebar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; margin: 10px 0 8px; box-shadow: inset 0 0 0 1px var(--line); }
.sharebar span { display: block; height: 100%; transition: width .5s ease; }
.share-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.share-legend span { cursor: pointer; }

.lead-clan { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-soft); cursor: pointer; }
.lead-clan:hover { border-color: var(--accent); }
.lead-clan .mon {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff; font-family: var(--font-serif); font-weight: 800; font-size: 20px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.22);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.lead-clan .nm { font-family: var(--font-serif); font-weight: 800; font-size: 17px; }
.lead-clan .sub { font-size: 12px; color: var(--muted); }

/* ranking */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 8px; }
.rank-list li:hover { background: var(--surface-2); }
.rank-list .rk { font-family: var(--font-serif); font-weight: 800; color: var(--muted); text-align: center; }
.rank-list .nm { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-list .nm .sw { flex: none; }
.rank-list .ld { font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .kk { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.rank-list .kk small { color: var(--muted); font-size: 11px; display: block; line-height: 1.2; }
.rank-list .bar { grid-column: 2 / 4; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.rank-list .bar span { display: block; height: 100%; background: var(--c); transition: width .5s ease; }

/* events list */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filters .tg span { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.filters .tg input:checked + span { color: var(--text); background: var(--surface-3); border-color: var(--b, var(--accent)); }
.ev-list { list-style: none; margin: 0; padding: 0; position: relative; }
.ev-list::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line-soft); }
.ev-item { position: relative; padding: 6px 8px 10px 26px; cursor: pointer; border-radius: 8px; }
.ev-item:hover { background: var(--surface-2); }
.ev-item::before { content: ''; position: absolute; left: 2px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--b); }
.ev-item.imp3::before { background: var(--b); }
.ev-item.future { opacity: .45; }
.ev-item.now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ev-item .d { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ev-item .ti { font-weight: 700; font-size: 14px; line-height: 1.45; }
.ev-item .pl { font-size: 12px; color: var(--text-2); }
.ev-year-head { font-family: var(--font-serif); font-weight: 800; color: var(--muted); font-size: 12.5px; padding: 8px 0 2px 26px; letter-spacing: .08em; }

/* people */
.people { display: grid; gap: 8px; }
.person { border: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.person:hover { border-color: var(--line); }
.person .top { display: flex; align-items: baseline; gap: 8px; }
.person .nm { font-family: var(--font-serif); font-weight: 800; font-size: 16px; }
.person .age { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.person .role { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.person .desc { display: none; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.person.open .desc { display: block; }
.person.dead { opacity: .7; }

/* detail */
.d-head { border-radius: var(--radius); padding: 16px; margin-bottom: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--accent)) 30%, var(--surface-2)), var(--surface-2)); border: 1px solid var(--line); }
.d-head .kind { font-size: 11.5px; color: var(--muted); letter-spacing: .1em; }
.d-head h2 { font-family: var(--font-serif); font-weight: 800; font-size: 24px; margin: 2px 0 4px; letter-spacing: .06em; line-height: 1.3; }
.d-head .meta { font-size: 12.5px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.d-text { font-size: 13.5px; color: var(--text-2); margin: 0 0 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin-bottom: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 6px; }
.hist li:hover { background: var(--surface-2); }
.hist li.cur { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.hist li.future { opacity: .55; }
.hist .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist .what { font-size: 13px; }
.hist .what .chip { margin-bottom: 3px; }
.leaders { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.leaders li { display: flex; gap: 10px; padding: 4px 0; color: var(--text-2); }
.leaders li.cur { color: var(--text); font-weight: 700; }
.leaders .when { width: 64px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line-soft); cursor: crosshair; }
.spark .ax { font-size: 10px; fill: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }

/* ── timeline ───────────────────────────── */
.timeline {
  border-top: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 8px 22px 6px;
  user-select: none;
  z-index: 4;
}
.tl-top { display: flex; align-items: center; gap: 18px; }
.tl-buttons { display: flex; gap: 6px; align-items: center; }
.tl-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; display: grid; place-items: center; }
.tl-btn:hover { border-color: var(--accent); }
.tl-btn.play { width: 46px; height: 46px; font-size: 17px; background: var(--accent); color: #1a1408; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
:root[data-theme="light"] .tl-btn.play { color: #fff8e6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tl-btn.play { color: #fff8e6; } }
.tl-date { display: flex; align-items: baseline; gap: 4px; font-family: var(--font-serif); min-width: 250px; }
.tl-year { font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-unit { font-size: 15px; margin-right: 6px; }
.tl-month { font-size: 17px; font-weight: 700; margin-right: 10px; font-variant-numeric: tabular-nums; }
.tl-gengo { font-size: 14px; color: var(--muted); }
.tl-opts { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.sel select { margin-left: 6px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.tg.small span { padding-left: 20px; position: relative; }
.tg.small span::before { content: ''; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.tg.small input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface-2); }

.tl-track { position: relative; height: 52px; margin-top: 8px; cursor: pointer; touch-action: none; outline: none; }
.tl-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.tl-eras { position: absolute; left: 0; right: 0; top: 0; height: 16px; }
.tl-eras div {
  position: absolute; top: 0; height: 100%; border-radius: 4px; font-size: 10.5px; line-height: 16px; padding-left: 6px;
  color: #fff8e6; overflow: hidden; white-space: nowrap; text-overflow: clip; opacity: .78; letter-spacing: .05em;
  border-right: 2px solid var(--surface);
}
.tl-eras div.cur { opacity: 1; box-shadow: 0 0 0 1px var(--accent-2) inset; }
.tl-rail { position: absolute; left: 0; right: 0; top: 28px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tl-progress { height: 100%; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), var(--accent)); }
.tl-evs { position: absolute; left: 0; right: 0; top: 20px; height: 22px; pointer-events: none; }
.tl-evs i { position: absolute; bottom: 0; width: 2px; margin-left: -1px; background: var(--b); border-radius: 1px; opacity: .8; }
.tl-evs i.imp1 { height: 6px; top: 16px; opacity: .45; }
.tl-evs i.imp2 { height: 10px; top: 12px; }
.tl-evs i.imp3 { height: 22px; top: 0; width: 3px; }
.tl-handle {
  position: absolute; top: 31px; left: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.4);
  pointer-events: none;
}
.tl-handle span {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #1a1408; font-weight: 800; font-size: 11px; padding: 0 6px; border-radius: 4px;
  opacity: 0; transition: opacity .2s; white-space: nowrap; font-variant-numeric: tabular-nums;
}
:root[data-theme="light"] .tl-handle span { color: #fff8e6; }
.tl-track.dragging .tl-handle span, .tl-track:hover .tl-handle span { opacity: 1; }
.tl-axis { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-axis span::before { content: ''; position: absolute; left: 50%; top: -5px; height: 4px; width: 1px; background: var(--line); }

/* ── modal ──────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 8, .6); display: grid; place-items: center; padding: 16px; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box { width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px 24px 24px; }
.modal-box.wide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.modal-head h2 { font-family: var(--font-serif); font-weight: 800; font-size: 20px; margin: 0; letter-spacing: .08em; }
.modal-head h2 small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 18px; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: auto; }
.seg + .modal-close { margin-left: 0; }
.seg button { border: 0; background: transparent; padding: 4px 14px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .axis text { fill: var(--muted); font-size: 11px; }
.chart-wrap .axis line, .chart-wrap .axis path { stroke: var(--line); }
.chart-wrap .area { stroke: var(--surface); stroke-width: .4; cursor: pointer; }
.chart-wrap .area.dim { opacity: .25; }
.chart-wrap .cur-line { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart-wrap .hover-line { stroke: var(--accent-2); stroke-width: 1; }
.chart-wrap .era-lab { font-size: 10.5px; fill: var(--muted); font-family: var(--font-serif); }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); min-width: 170px; }
.chart-tip .h { font-weight: 700; margin-bottom: 4px; font-family: var(--font-serif); }
.chart-tip div.r { display: flex; justify-content: space-between; gap: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.about { font-size: 14px; color: var(--text-2); }
.about h3 { font-family: var(--font-serif); color: var(--text); font-size: 16px; margin: 18px 0 6px; letter-spacing: .08em; }
.about ul { padding-left: 1.3em; margin: 0; }
.about li { margin: 4px 0; }

/* ── responsive ─────────────────────────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .tl-opts .tg.small span { font-size: 0; }
  .tl-opts .tg.small span::after { content: '一時停止'; font-size: 12.5px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
  .topbar { position: sticky; top: 0; padding: 8px 12px; flex-wrap: wrap; }
  .brand-mark { width: 34px; height: 34px; font-size: 19px; }
  .brand-title { font-size: 19px; }
  .tools { width: 100%; justify-content: space-between; }
  .toggles .tg span { padding: 3px 9px; }
  #btn-chart { padding: 5px 10px; }
  .layout { display: flex; flex-direction: column; }
  .map-wrap { height: 64vh; min-height: 360px; }
  .timeline { order: 0; position: sticky; bottom: 0; padding: 6px 14px 4px; background: var(--surface); box-shadow: 0 -6px 18px rgba(0,0,0,.18); }
  .tl-axis span:nth-child(even) { display: none; }
  .tools { flex-wrap: nowrap; gap: 6px; }
  .toggles { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .btn .long { display: none; }
  .btn .short { display: inline; }
  .btn.icon { width: 32px; height: 32px; flex: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line-soft); min-height: 70vh; }
  .panel-body { overflow: visible; }
  .detail { position: fixed; inset: 0; z-index: 40; }
  .watermark { left: 12px; top: 10px; }
  .wm-sub { font-size: 13px; }
  .map-legend { display: none; }
  .map-ctrl { right: 10px; top: 10px; }
  .tl-top { gap: 10px; flex-wrap: wrap; }
  .tl-date { min-width: 0; }
  .tl-year { font-size: 24px; }
  .tl-gengo { display: none; }
  .tl-opts { gap: 8px; }
  .tl-opts .tg.small { display: none; }
  .tl-btn { width: 32px; height: 32px; }
  .tl-btn.play { width: 40px; height: 40px; }
  .tl-eras div { font-size: 0; }
  .toast { bottom: 10px; }
}
@media (pointer: coarse) {
  #map { touch-action: pan-x pan-y; }
}
.touch-hint {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: rgba(0, 0, 0, .42); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .05em;
  animation: fade .2s;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================================================================
   ブラッシュアップ：家紋・諸説・陣営・合戦アニメ
   ================================================================ */
.kamon { display: block; flex: none; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.15); }
.lead-clan .kamon { box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.rank-list .nm .kamon { width: 26px; height: 26px; }
.d-head { position: relative; }
.d-kamon { position: absolute; right: 14px; top: 14px; }
.d-kamon ~ .kind, .d-kamon ~ h2 { padding-right: 74px; }
.label-kamon { overflow: visible; }
.small { font-size: 12px; }
.btn.accent { background: var(--accent); border-color: transparent; color: #1a1408; font-weight: 700; }
.btn.accent:hover { background: var(--accent-2); }
:root[data-theme="light"] .btn.accent { color: #fff8e6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn.accent { color: #fff8e6; } }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .4; cursor: default; }

.alt-badge {
  display: inline-block; font-size: 10.5px; line-height: 1.6; padding: 0 6px; border-radius: 4px;
  border: 1px dashed var(--muted); color: var(--muted); font-weight: 700;
}
.anim-badge { display: inline-block; font-size: 10.5px; line-height: 1.6; padding: 0 6px; border-radius: 4px; background: var(--accent); color: #1a1408; font-weight: 700; }
:root[data-theme="light"] .anim-badge { color: #fff8e6; }
.alt-note {
  font-size: 12.5px; color: var(--text-2); margin: 0 0 14px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); border-left: 3px dashed var(--muted);
}
.alt-note b { color: var(--muted); margin-right: 8px; font-size: 11.5px; }
.alt-note.small { display: block; margin: 6px 0 0; padding: 4px 8px; font-size: 11.5px; }
.tooltip .tt-note.alt { color: var(--muted); border-top: 1px dashed var(--line); padding-top: 4px; }
.anim-box { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.anim-box .btn { text-align: left; }
.btn.anim { border-color: var(--accent); }
.btn.anim.battle { background: var(--accent); color: #1a1408; font-weight: 700; border-color: transparent; }
:root[data-theme="light"] .btn.anim.battle { color: #fff8e6; }
.toast .anim-box { margin: 10px 0 0; flex-direction: row; flex-wrap: wrap; }
.toast .anim-box .btn { font-size: 12px; padding: 4px 10px; }

/* 陣営 */
.camp-bar {
  position: absolute; right: 60px; top: 14px; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 13px;
}
.cb-title { font-family: var(--font-serif); font-weight: 800; white-space: nowrap; }
.cb-btn { border: 0; border-radius: 999px; padding: 4px 14px; background: var(--accent); color: #1a1408; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.cb-btn.on { background: var(--surface-3); color: var(--text); }
:root[data-theme="light"] .cb-btn:not(.on) { color: #fff8e6; }
.camp-list { display: grid; gap: 6px; font-size: 13px; }
.camp-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }

/* 進軍ルート */
.camp-layer { pointer-events: none; }
.r-planned { fill: none; stroke-width: 2px; stroke-dasharray: 2 6; stroke-linecap: round; }
.r-casing { fill: none; stroke: var(--label-halo); stroke-width: 8px; stroke-linecap: round; stroke-linejoin: round; }
.r-done { fill: none; stroke-width: 4.5px; stroke-linecap: round; stroke-linejoin: round; }
.r-head .r-dot { stroke: #fff8e6; stroke-width: 2.5px; }
.r-head .r-arrow { stroke: #fff8e6; stroke-width: 1.5px; }
.r-name {
  font-family: var(--font-serif); font-weight: 800; font-size: 13px; text-anchor: middle; fill: var(--label);
  paint-order: stroke; stroke: var(--label-halo); stroke-width: 3.5px;
}
.r-stop circle { fill: var(--surface); stroke-width: 2px; }
.r-stop.reached circle { fill: #fff8e6; }
.r-stop-lbl { font-size: 12px; font-weight: 700; fill: var(--label); paint-order: stroke; stroke: var(--label-halo); stroke-width: 3px; }
.map-wrap.anim-on .map-legend, .map-wrap.anim-on .camp-bar { display: none; }

.camp-player {
  position: absolute; left: 16px; bottom: 16px; z-index: 7; width: min(400px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 12px; padding: 12px 14px 12px; box-shadow: var(--shadow);
}
.cp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cp-kicker { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .15em; }
.cp-head h3 { margin: 0; font-family: var(--font-serif); font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.cp-x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; flex: none; }
.cp-lead { margin: 6px 0 8px; font-size: 12.5px; color: var(--muted); }
.cp-routes { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.cp-routes .chip { cursor: default; }
.cp-date { font-family: var(--font-serif); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.cp-text { font-size: 13px; color: var(--text-2); min-height: 3.2em; margin: 4px 0 10px; }
.cp-text .chip { cursor: default; }
.cp-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; cursor: pointer; }
.cp-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.cp-ctrl { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.cp-ctrl > button:not(.btn) { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.cp-ctrl .cp-play { background: var(--accent) !important; color: #1a1408; border-color: transparent !important; }
.cp-ctrl .btn { margin-left: auto; }

/* 合戦図 */
.battle-box { width: min(1280px, 100%); padding: 16px 18px 18px; }
.battle-box .modal-head { flex-wrap: wrap; }
.bt-sides { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.bt-sides .chip { cursor: default; }
.bt-sides + .modal-close { margin-left: 0; }
.bt-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.bt-stage { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
#bt-svg { display: block; width: 100%; height: auto; }
.bt-side { display: flex; flex-direction: column; }
.bt-time { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.bt-head { font-family: var(--font-serif); font-weight: 800; font-size: 22px; margin: 2px 0 8px; letter-spacing: .06em; }
.bt-text { font-size: 13.5px; color: var(--text-2); margin: 0 0 12px; min-height: 8.5em; }
.bt-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bt-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bt-steps { display: grid; gap: 4px; margin: 12px 0 4px; }
.bt-steps button {
  display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line-soft); background: var(--surface-2);
  border-radius: 8px; padding: 4px 8px; font-size: 12.5px; color: var(--muted);
}
.bt-steps button span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 11px; font-weight: 700; flex: none; }
.bt-steps button em { font-style: normal; }
.bt-steps button.done { color: var(--text-2); }
.bt-steps button.cur { color: var(--text); border-color: var(--accent); }
.bt-steps button.cur span { background: var(--accent); color: #1a1408; }

/* 合戦図のSVG（古地図風。両テーマ共通の配色） */
#bt-svg { --bt-ink: #2b2317; }
.bt-bg { fill: #e9dfc6; }
.bt-sea { fill: #b9ccd0; stroke: #8fa9b0; stroke-width: 1.5; }
.bt-hill.h0 { fill: #d7caa6; stroke: #b9a67a; stroke-width: 1; }
.bt-hill.h1 { fill: #cbbb8f; stroke: #ab9565; stroke-width: 1; }
.bt-hill.h2 { fill: #bda877; stroke: #9a8352; stroke-width: 1; }
.bt-river { fill: none; stroke: #7fa6c4; stroke-width: 5; stroke-linecap: round; opacity: .85; }
.bt-road { fill: none; stroke: #9a7b52; stroke-width: 2.5; stroke-dasharray: 9 6; opacity: .8; }
.bt-fence { fill: none; stroke: #5b3d1e; stroke-width: 5; stroke-linejoin: round; }
.bt-fence-x { fill: none; stroke: #5b3d1e; stroke-width: 14; stroke-dasharray: 2 12; }
.bt-fort { fill: #5b3d1e; stroke: #fff8e6; stroke-width: 1.5; }
.bt-place { fill: #5b3d1e; }
.bt-lbl { font-family: var(--font-serif); font-weight: 700; fill: var(--bt-ink); font-size: 14px; paint-order: stroke; stroke: rgba(233,223,198,.85); stroke-width: 3px; }
.bt-lbl.hill { text-anchor: middle; font-size: 15px; fill: #5a4424; }
.bt-lbl.river { fill: #3f6f94; font-size: 13px; }
.bt-lbl.road { fill: #6d5230; font-size: 12.5px; }
.bt-lbl.sea { fill: #3f6f94; }
.bt-lbl.fence { fill: #5b3d1e; font-size: 13px; }
.bt-lbl.note { fill: #6d5230; font-size: 13px; }
.bt-compass { font-family: var(--font-serif); font-weight: 800; font-size: 14px; fill: #6d5230; }
.bt-arrow { fill: none; stroke-width: 4; stroke-linecap: round; opacity: .9; }
.bt-box { stroke: rgba(30,20,10,.75); stroke-width: 1.5; }
.bt-unit.big .bt-box { stroke: #f3d27a; stroke-width: 3; }
.bt-name { fill: #fff; font-family: var(--font-serif); font-weight: 800; font-size: 12.5px; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2px; }
.bt-str { fill: rgba(255,255,255,.9); font-size: 10.5px; text-anchor: middle; }
.bt-badge rect { fill: #2b2317; }
.bt-badge text { fill: #fff8e6; font-size: 11px; font-weight: 700; text-anchor: middle; }
.bt-cross { stroke: rgba(255,255,255,.75); stroke-width: 2.5; display: none; }
.bt-hl { fill: none; stroke: #f3d27a; stroke-width: 3; opacity: 0; }
.bt-unit.hl .bt-hl { animation: btPulse 1.4s ease-in-out infinite; }
@keyframes btPulse { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
.bt-unit[data-st="rout"] { opacity: .5; }
.bt-unit[data-st="rout"] .bt-box { stroke-dasharray: 5 3; }
.bt-unit[data-st="dead"] { opacity: .65; }
.bt-unit[data-st="dead"] .bt-cross { display: block; }
.bt-unit[data-st="idle"] .bt-box { stroke-dasharray: 3 3; stroke-width: 2; }
.bt-unit[data-st="win"] .bt-box { filter: drop-shadow(0 0 8px rgba(243,210,122,.95)); }
.bt-fire circle { fill: #ffb43a; opacity: 0; animation: btFire 1s ease-out infinite; }
@keyframes btFire { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(46px); } }

/* 一覧 */
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.anim-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); transition: border-color .2s, transform .2s;
}
.anim-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.anim-card.battle { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface-2)), var(--surface-2)); }
.ac-kicker { font-size: 11.5px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.ac-title { font-family: var(--font-serif); font-weight: 800; font-size: 18px; }
.ac-date { font-size: 12px; color: var(--muted); }
.ac-desc { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ac-sides { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ac-sides .chip { cursor: inherit; font-size: 11.5px; }

@media (max-width: 1100px) {
  .bt-body { grid-template-columns: 1fr; }
  .bt-text { min-height: 0; }
  .bt-steps { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 860px) {
  .camp-bar { right: 56px; top: 10px; font-size: 12px; padding: 4px 4px 4px 10px; }
  .camp-player { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px 12px; }
  .cp-lead { display: none; }
  .cp-head h3 { font-size: 17px; }
  .cp-text { min-height: 0; }
  .battle-box { padding: 12px; }
  .bt-head { font-size: 18px; }
  .sel select { font-size: 16px; }   /* iOS でフォーカス時に拡大されないように */
  .modal { padding: 0; }
  .modal-box { border-radius: 0; max-height: 100dvh; min-height: 100dvh; }
}
.bt-rain-fx { animation: btRain .5s linear infinite; }
@keyframes btRain { from { transform: translateY(-24px); } to { transform: translateY(0); } }
.map-wrap.anim-on .clan-label { opacity: .4; }
.map-wrap.anim-on .label-kamon { display: none; }
.map-wrap.anim-on .ev { opacity: .35 !important; }
@media (max-width: 860px) {
  .bt-stage { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #bt-svg { min-width: 680px; }
}
@media (max-width: 860px) {
  .toggles .tg { flex: none; }
  .toggles .tg span { white-space: nowrap; }
  .cp-routes { display: none; }
  .cp-head h3 { font-size: 16px; }
  .cp-date { font-size: 15px; }
  .cp-text { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 8px; }
  .cp-ctrl { margin-top: 8px; }
  .cp-ctrl > button:not(.btn) { width: 30px; height: 30px; }
}
.btn { white-space: nowrap; }
@media (max-width: 860px) {
  .r-name { font-size: 11px; }
  .r-stop-lbl { font-size: 10.5px; }
  #btn-anim, #btn-chart { padding: 5px 10px; }
}


/* ================================================================
   ブラッシュアップ：動きとアイコン
   ================================================================ */
/* 国を取ったときの矢印と文字 */
.ripple-g.conq { pointer-events: none; }
.conq-arrow { fill: none; stroke: var(--c); stroke-width: 4.5px; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.3,.7,.3,1);
  filter: drop-shadow(0 0 2px #fff8e6) drop-shadow(0 1px 2px rgba(0,0,0,.45)); animation: conqFade 2.8s ease forwards; }
.conq-casing { fill: none; stroke: #2b2317; stroke-width: 8px; stroke-linecap: round; opacity: .75; transition: stroke-dashoffset .8s cubic-bezier(.3,.7,.3,1); animation: conqFade 2.8s ease forwards; }
.conq-head { fill: var(--c); stroke: #2b2317; stroke-width: 1.6px; opacity: 0; animation: conqHead 2.8s ease forwards; }
@keyframes conqHead { 0%, 25% { opacity: 0; } 32%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes conqFade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.conq-label { opacity: 0; animation: conqRise 2.7s ease-out forwards; }
.conq-label rect { fill: var(--panel, #fbf6ea); stroke: var(--c); stroke-width: 2px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.conq-label text { font-family: var(--font-serif); font-weight: 800; font-size: 13px; fill: var(--ink, #2b2317); text-anchor: middle; }
@keyframes conqRise { 0% { opacity: 0; translate: 0 8px; } 12% { opacity: 1; translate: 0 0; } 78% { opacity: 1; } 100% { opacity: 0; translate: 0 -14px; } }

/* 出来事の印：はじけて現れる */
.ev.pop circle.dot, .ev.pop text { transform-box: fill-box; transform-origin: center; animation: evPop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes evPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.ev-burst { fill: none; stroke: #ffb43a; stroke-width: 2.4px; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ev.pop .ev-burst { animation: evBurst .9s ease-out; }
@keyframes evBurst { 0% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.6); } }

/* 年の数字 */
.wm-year.roll { animation: yearRoll .45s cubic-bezier(.2,.8,.3,1); }
@keyframes yearRoll { 0% { transform: translateY(-40%); opacity: 0; filter: blur(2px); } 100% { transform: none; opacity: 1; } }

/* 年表のマウスオーバー */
.tl-hover { position: absolute; bottom: 58px; transform: translateX(-50%); background: #2b2317; color: #fff8e6; font-size: 12px; line-height: 1.5;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.tl-hover small { opacity: .7; margin-left: 4px; }
.tl-hover::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: #2b2317; border-bottom: 0; }

/* 進軍ルートの先頭：家紋の円盤 */
.r-head .r-dot { stroke: #fff8e6; stroke-width: 2.5px; }
.r-head .r-kamon { pointer-events: none; }
.r-pulse { fill: none; stroke-width: 2.5px; animation: rPulse 1.5s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes rPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }

/* 合戦図の部隊：旗指物と兵 */
.bt-unit .bt-box { stroke: rgba(30,20,10,.7); stroke-width: 1; transform-box: fill-box; transform-origin: 0 50%; animation: nobori 2.4s ease-in-out infinite; }
.bt-unit.big .bt-box { stroke: #f3d27a; stroke-width: 2; }
@keyframes nobori { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(.9); } }
.bt-pole { stroke: #3a2a18; stroke-width: 1.6; }
.bt-flag-ch { fill: #fff8e6; font-family: var(--font-serif); font-weight: 800; font-size: 11px; text-anchor: middle; pointer-events: none; }
.bt-umajirushi { fill: #e8b93a; stroke: #6b4a12; stroke-width: 1.2; }
.bt-troops .sol { animation: none; }
.bt-troops .kabuto { fill: #2b2317; }
.bt-troops .do { fill: var(--sc); stroke: rgba(20,12,4,.7); stroke-width: .8; }
.bt-troops .yari { stroke: #4a3a26; stroke-width: 1.1; }
.bt-troops .teppo { stroke: #2b2317; stroke-width: 1.6; stroke-linecap: round; }
.bt-troops .uma { fill: #5b4632; stroke: #2b2317; stroke-width: .6; }
.bt-troops .jinmaku { fill: #fff8e6; stroke: var(--sc); stroke-width: 1.5; }
.bt-troops .jinmaku-line { stroke: var(--sc); stroke-width: 2.2; }
.bt-troops .saku { stroke: #5b4632; stroke-width: 1.6; fill: none; }
.bt-troops .shiro { fill: #e9e1cc; stroke: #2b2317; stroke-width: 1; }
.bt-smoke circle { fill: #d9d4c7; opacity: 0; }
.bt-unit[data-st="fire"] .bt-smoke circle { animation: gunSmoke 1.2s ease-out infinite; }
.bt-unit[data-st="fire"] .bt-smoke circle:nth-child(2) { animation-delay: .3s; }
.bt-unit[data-st="fire"] .bt-smoke circle:nth-child(3) { animation-delay: .6s; }
@keyframes gunSmoke { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2) translate(4px,-6px); } }
.bt-plate { fill: rgba(251,246,234,.94); stroke: var(--sc); stroke-width: 2; }
.bt-name { fill: #2b2317; font-size: 12px; paint-order: normal; stroke: none; }
.bt-str { fill: #6b5a44; font-size: 10px; }
.bt-cross { stroke: #8f1e17; stroke-width: 3.5; }
/* 移動中は兵が上下に揺れる（行軍） */
.bt-unit.moving .sol { animation: march .32s ease-in-out infinite alternate; }
.bt-unit.moving.k-cav .sol { animation: gallop .22s ease-in-out infinite alternate; }
@keyframes march { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes gallop { from { transform: translateY(0) rotate(0); } to { transform: translateY(-3px) rotate(-4deg); } }
.bt-unit .sol { transform-box: fill-box; transform-origin: center bottom; }
/* 状態 */
.bt-unit[data-st="rout"] { opacity: .75; }
.bt-unit[data-st="rout"] .sol { animation: scatter 1.2s ease-out forwards; }
.bt-unit[data-st="rout"] .sol:nth-child(odd) { --dx: -8px; }
.bt-unit[data-st="rout"] .sol:nth-child(even) { --dx: 8px; }
@keyframes scatter { to { transform: translate(var(--dx, 6px), 6px) rotate(20deg); opacity: .35; } }
.bt-unit[data-st="rout"] .bt-flag { transform-box: fill-box; transition: transform .8s; }
.bt-unit[data-st="rout"] .bt-box { animation: none; transform: skewY(-18deg); opacity: .75; }
.bt-unit[data-st="dead"] .bt-troops { opacity: .25; filter: grayscale(1); }
.bt-unit[data-st="dead"] .bt-flag { transform-box: fill-box; transform-origin: bottom center; transform: rotate(72deg) translate(0,0); transition: transform 1s; }
.bt-unit[data-st="dead"] .bt-box { animation: none; }
.bt-unit[data-st="idle"] .bt-troops { opacity: .55; }
.bt-unit[data-st="idle"] .bt-box { animation-duration: 6s; }
.bt-unit[data-st="turn"] .bt-flag { animation: turnFlip 1s ease-in-out; transform-box: fill-box; transform-origin: center; }
@keyframes turnFlip { 0% { transform: scaleX(1); } 50% { transform: scaleX(-.1); } 100% { transform: scaleX(1); } }
.bt-unit[data-st="win"] .bt-flag { animation: winFlag .7s ease-in-out 3; transform-box: fill-box; transform-origin: bottom center; }
@keyframes winFlag { 50% { transform: translateY(-6px); } }
.bt-unit[data-st="win"] .bt-plate { filter: drop-shadow(0 0 7px rgba(243,210,122,.95)); }
.bt-fire .flash { fill: #ffe38a; opacity: 0; animation: btFlash .9s ease-out infinite; }
.bt-fire .smoke { fill: #d9d4c7; opacity: 0; animation: gunSmoke 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes btFlash { 0% { opacity: 1; r: 4; } 30% { opacity: .9; } 100% { opacity: 0; r: 1; } }
/* ぶつかり合い */
.bt-clash { opacity: 0; animation: clash 1.6s ease-out forwards; pointer-events: none; }
.bt-clash .dust { fill: #c9b793; opacity: .7; }
.bt-clash .spark { stroke-width: 3; stroke-linecap: round; fill: none; }
@keyframes clash { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1.1); } 60% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }
.bt-clash { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  .bt-unit .bt-box, .r-pulse, .conq-label, .conq-arrow, .ev.pop * { animation: none !important; }
}

/* 幕末の部隊 */
.bt-troops .jingasa { fill: #2b2317; }
.bt-troops .kao { fill: #e2c9a4; }
.bt-troops .jugun { stroke: #3a2a18; stroke-width: 1.3; stroke-linecap: round; }
.bt-troops .hoshin { stroke: #2b2317; stroke-width: 3; stroke-linecap: round; }
.bt-troops .hoshin-g { fill: #3a3a3a; }
.bt-troops .sharin { fill: none; stroke: #5b4632; stroke-width: 1.6; }
.bt-troops .jiku { fill: #5b4632; }
.bt-troops .dai { stroke: #5b4632; stroke-width: 2; }
.bt-troops .daiba { fill: #b8ad95; stroke: #5b5242; stroke-width: 1.2; }
.bt-troops .sentai { fill: #2b2621; stroke: #0f0c09; stroke-width: .8; }
.bt-troops .gen { stroke: var(--sc); stroke-width: 1.8; }
.bt-troops .hashira { stroke: #3a2a18; stroke-width: 1.4; }
.bt-troops .yard { stroke: #3a2a18; stroke-width: 1; }
.bt-troops .entotsu { fill: #1d1a17; }
.bt-troops .gairin { fill: #4a3a2a; stroke: #1d1a17; stroke-width: .8; }
.bt-troops .hata { fill: var(--sc); }
.bt-troops .kemuri circle { fill: #6b6660; opacity: .55; animation: kemuri 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.bt-troops .kemuri circle:nth-child(2) { animation-delay: .8s; }
.bt-troops .kemuri circle:nth-child(3) { animation-delay: 1.6s; }
@keyframes kemuri { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.8) translate(-6px,-6px); } }
.bt-unit.k-ship.moving .fune, .bt-unit.k-kurofune.moving .fune { animation: nami 1.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes nami { from { transform: rotate(-2deg) translateY(0); } to { transform: rotate(2deg) translateY(1px); } }
.bt-unit[data-st="fire"].k-art .bt-smoke circle, .bt-unit[data-st="fire"].k-ship .bt-smoke circle, .bt-unit[data-st="fire"].k-kurofune .bt-smoke circle,
.bt-unit[data-st="fire"].k-battery .bt-smoke circle, .bt-unit[data-st="fire"].k-gatling .bt-smoke circle { animation: gunSmoke 1.2s ease-out infinite; }
.bt-unit[data-st="dead"].k-ship .bt-troops, .bt-unit[data-st="dead"].k-kurofune .bt-troops { transform-box: fill-box; opacity: .35; }

/* 降伏（白旗）・炎上・沈没 */
.bt-unit[data-st="surr"] .bt-box { animation: none; stroke: #6b5a44; }
.bt-unit[data-st="surr"] .bt-flag-ch, .bt-unit[data-st="surr"] .bt-flag-kamon { display: none; }
.bt-unit[data-st="surr"] .bt-troops { opacity: .5; }
.bt-unit[data-st="burn"] .bt-smoke circle { animation: gunSmoke 1.6s ease-out infinite; fill: #4a4540; }
.bt-unit[data-st="burn"] .bt-troops { filter: drop-shadow(0 0 5px #ff8a1f) sepia(.4); }
.bt-unit[data-st="sunk"] .bt-troops { opacity: .3; filter: grayscale(1); transform: translateY(6px) rotate(8deg); transform-box: fill-box; transition: transform 1.5s, opacity 1.5s; }
.bt-unit[data-st="sunk"] .bt-cross { display: block; }
/* 非表示（あとから登場する部隊） */
.bt-unit { transition: opacity .6s; }
.bt-unit[data-st="hide"] { opacity: 0; pointer-events: none; }

/* ══════════ 中国史エンジンの追加 ══════════ */
.big-river { fill: none; stroke: var(--river, #6f9fc4); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; opacity: .85; vector-effect: non-scaling-stroke; pointer-events: none; }
.ctx-name.people { letter-spacing: .3em; font-size: 17px; font-style: normal; opacity: .6; }
.ctx-name.sea { font-size: 16px; letter-spacing: .6em; opacity: .5; fill: var(--sea-label, #7f98ad); }
/* 合戦図：兵種 */
.bt-troops .yumi { fill: none; stroke: #4a3a26; stroke-width: 1.2; }
.bt-troops .tsuru { stroke: #8a7a5c; stroke-width: .5; }
.bt-troops .ya { stroke: #4a3a26; stroke-width: .8; }
.bt-troops .nagae { stroke: #5b4632; stroke-width: 1.3; }
.bt-troops .sha { fill: #7a5a3a; stroke: #2b2317; stroke-width: .7; }
.bt-troops .hoko { stroke: #4a3a26; stroke-width: 1.4; }
.bt-troops .ro { fill: #5a3e2a; stroke: #1f140c; stroke-width: .6; }
.bt-troops .yane { fill: #3a2a1c; stroke: #1f140c; stroke-width: 1.4; }
.bt-troops .kai { stroke: #3a2a18; stroke-width: 1.2; }
.bt-troops .takigi { fill: none; stroke: #c9582a; stroke-width: 2; }
.bt-troops .joheki { fill: #a89878; stroke: #5b4b33; stroke-width: 1; }
.bt-troops .jokou { fill: none; stroke: #5b4b33; stroke-width: 1; }
.bt-troops .mon { fill: #3a2a1c; }
.bt-fire .arrow-fly { stroke: #3a2a18; stroke-width: 1.2; opacity: 0; animation: arrowFly 1.1s ease-in infinite; }
@keyframes arrowFly { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), 14px); } }
.bt-fire .flame { fill: #ff8a2a; opacity: .9; animation: flameFlick .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom center; }
@keyframes flameFlick { from { transform: scale(.85, .8); fill: #ffb43a; } to { transform: scale(1.1, 1.2); fill: #e0461f; } }
.bt-fire .smoke.dark, .bt-fire circle.smoke.dark { fill: #3d3833; opacity: 0; animation: gunSmoke 1.8s ease-out infinite; }
.bt-unit[data-st="burn"] .bt-troops { filter: saturate(.6) brightness(.8); }
.bt-unit[data-st="sunk"] { opacity: .35; }
.bt-unit[data-st="flee"] { opacity: .6; }
.bt-unit[data-st="siege"] .bt-box { stroke: #f3d27a; stroke-width: 2; }
.bt-wood { fill: #7d9a64; opacity: .35; }
.bt-wall { fill: none; stroke: #7a6a4c; stroke-width: 6; stroke-linejoin: round; opacity: .8; }
.bt-lbl.wall { fill: #5b4b33; }
.bt-night { fill: #0c1020; opacity: 0; }
.bt-flood { fill: #6f9fc4; opacity: 0; mix-blend-mode: multiply; }
.bt-wind .wind-line { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 26 200; animation: windBlow 2.2s linear infinite; }
@keyframes windBlow { from { stroke-dashoffset: 120; } to { stroke-dashoffset: -110; } }
@media (prefers-reduced-motion: reduce) { .bt-wind .wind-line, .bt-fire .arrow-fly, .bt-fire .flame { animation: none; } }
.bt-unit[data-st="ill"] .bt-troops { opacity: .35; filter: grayscale(1); }
.bt-unit[data-st="ill"] .bt-box { fill: #e9e3d3 !important; }
.portal-link { flex: none; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.portal-link:hover { background: var(--surface-2, rgba(0,0,0,.05)); }
@media (max-width: 1100px) { .portal-link { display: none; } }

/* ══════════ 作品ごとの配色と年表 ══════════ */
/* ── 三国志：朱と墨、竹簡の年表 ── */
.sangoku { --accent: #c0392b; --accent-2: #e07b5f; --river: #5f93bf; }
:root.sangoku[data-theme="light"] { --accent: #a3271f; --accent-2: #c9553e; }
@media (prefers-color-scheme: light) { :root.sangoku:not([data-theme="dark"]) { --accent: #a3271f; --accent-2: #c9553e; } }
.sangoku .brand-mark { border-radius: 6px; background: #a3271f; box-shadow: inset 0 0 0 2px #f3dfb5, inset 0 0 0 4px #a3271f, 0 2px 10px rgba(163,39,31,.35); }
.sangoku .timeline {
  --slip-a: #e8d4a0; --slip-b: #d7bd82; --slip-line: #b89a5c; --cord: #7a2a1c; --ink: #2b1d12;
  background:
    linear-gradient(var(--cord), var(--cord)) 0 36px / 100% 2px no-repeat,
    linear-gradient(var(--cord), var(--cord)) 0 calc(100% - 16px) / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--slip-a) 0 20px, var(--slip-b) 20px 21px, var(--slip-line) 21px 22px, var(--slip-a) 22px 23px);
  color: var(--ink); border-top: 3px solid #5a3a22;
}
:root.sangoku:not([data-theme="light"]) .timeline { --slip-a: #4a3a24; --slip-b: #3e301d; --slip-line: #2b2114; --cord: #b0543a; --ink: #f1e2bf; }
@media (prefers-color-scheme: light) { :root.sangoku:not([data-theme="dark"]) .timeline { --slip-a: #e8d4a0; --slip-b: #d7bd82; --slip-line: #b89a5c; --cord: #7a2a1c; --ink: #2b1d12; } }
.sangoku .timeline .tl-gengo, .sangoku .timeline .tl-axis, .sangoku .timeline .tl-opts { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.sangoku .tl-year { font-size: 34px; color: var(--ink); }
.sangoku .tl-btn { border-radius: 4px; background: color-mix(in srgb, var(--slip-a) 70%, #fff); border-color: var(--slip-line); color: var(--ink); }
.sangoku .tl-btn.play { border-radius: 6px; background: #a3271f; color: #f6e7c1; box-shadow: inset 0 0 0 2px #f3dfb5, inset 0 0 0 3px #a3271f; }
.sangoku .tl-rail { background: color-mix(in srgb, var(--ink) 18%, transparent); height: 5px; border-radius: 0; }
.sangoku .tl-progress { background: linear-gradient(90deg, rgba(20,12,6,.15), rgba(20,12,6,.85)); }
:root.sangoku:not([data-theme="light"]) .tl-progress { background: linear-gradient(90deg, rgba(240,220,180,.15), rgba(240,220,180,.8)); }
.sangoku .tl-eras div { border-radius: 2px; font-family: var(--font-serif); }
.sangoku .tl-handle { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 4px; background: #a3271f; border: 2px solid #f3dfb5; box-shadow: 0 0 0 1px #a3271f, 0 3px 10px rgba(0,0,0,.35); }
.sangoku .tl-handle::after { content: '印'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 12px var(--font-serif); color: #f6e7c1; }
.sangoku .tl-handle span { background: #a3271f; color: #f6e7c1; border-radius: 2px; }
.sangoku .wm-year { font-size: clamp(48px, 7vw, 100px); }
.sangoku .kamon.banner rect:first-child { rx: 6; }

.bt-troops .ushi { fill: #5a4030; stroke: #2b1d12; stroke-width: .6; }
.bt-troops .tsuno { stroke: #d8d0c0; stroke-width: 1.2; }
.bt-troops .tail-fire { fill: #ff8a2a; animation: flameFlick .4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: right center; }
/* ── 春秋戦国：青銅と玉、雷文の年表 ── */
.shunju { --accent: #b58a3a; --accent-2: #d8b26a; --river: #6a9fb0; }
:root.shunju[data-theme="light"] { --accent: #3f7a6a; --accent-2: #6aa08e; }
@media (prefers-color-scheme: light) { :root.shunju:not([data-theme="dark"]) { --accent: #3f7a6a; --accent-2: #6aa08e; } }
.shunju .brand-mark { border-radius: 50%; background: radial-gradient(circle, #f0e6c8 0 22%, #3f7a6a 23% 100%); color: transparent; box-shadow: inset 0 0 0 3px #c9a86a, 0 2px 10px rgba(63,122,106,.4); }
.shunju .timeline {
  --bz: #34463f; --bz-2: #2a3833; --bz-line: #b8955a; --tl-ink: #efe4c6;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(184,149,90,.5) 10px 12px, transparent 12px 14px, rgba(184,149,90,.5) 14px 16px, transparent 16px 26px) 0 0 / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(184,149,90,.5) 10px 12px, transparent 12px 14px, rgba(184,149,90,.5) 14px 16px, transparent 16px 26px) 0 100% / 100% 5px no-repeat,
    linear-gradient(var(--bz), var(--bz-2));
  color: var(--tl-ink); border-top: 2px solid var(--bz-line);
}
.shunju .timeline .tl-gengo, .shunju .timeline .tl-axis, .shunju .timeline .tl-opts, .shunju .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 72%, transparent); }
.shunju .tl-year { color: #f3e3b8; font-size: 32px; letter-spacing: .02em; }
.shunju .tl-btn { background: #2a3833; border-color: #6d7f68; color: #efe4c6; }
.shunju .tl-btn.play { background: radial-gradient(circle, #3f7a6a 0 48%, #c9a86a 50% 56%, #3f7a6a 58%); color: #f3e3b8; }
.shunju .tl-rail { background: rgba(0,0,0,.35); height: 6px; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(184,149,90,.35); }
.shunju .tl-progress { background: linear-gradient(90deg, rgba(90,160,140,.2), #6fb09a); }
.shunju .tl-eras div { color: #f3e8cc; font-family: var(--font-serif); border-radius: 0; }
.shunju .tl-handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 0;
  background: radial-gradient(circle, var(--bz-2) 0 26%, #8fc4ae 28% 62%, #5f9a84 64% 100%); box-shadow: 0 0 0 2px #c9a86a, 0 3px 12px rgba(0,0,0,.5); }
.shunju .tl-handle span { background: #c9a86a; color: #1c1a12; }
.shunju .tl-axis span::before { background: #b8955a; }
.shunju .tl-opts select { background: #2a3833; color: #efe4c6; border-color: #6d7f68; }
/* ── 北宋末期：青磁と絵巻、巻物の年表 ── */
.hokuso { --accent: #5f9a8a; --accent-2: #8cc0b0; --river: #6c9cb8; }
:root.hokuso[data-theme="light"] { --accent: #3f7f70; --accent-2: #6aa596; }
@media (prefers-color-scheme: light) { :root.hokuso:not([data-theme="dark"]) { --accent: #3f7f70; --accent-2: #6aa596; } }
.hokuso .brand-mark { border-radius: 4px; background: linear-gradient(90deg, #5a3a22 0 12%, #eadfc4 12% 88%, #5a3a22 88%); color: #3f7f70; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hokuso .timeline {
  --silk: #ece2c8; --silk-2: #e2d6b6; --ink: #2d2a22; --roller: #5a3a22;
  position: relative;
  background:
    radial-gradient(120px 40px at 18% 100%, rgba(95,130,115,.22), transparent 70%),
    radial-gradient(160px 50px at 55% 100%, rgba(95,130,115,.18), transparent 70%),
    radial-gradient(110px 36px at 86% 100%, rgba(95,130,115,.22), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120,100,60,.05) 0 1px, transparent 1px 3px),
    linear-gradient(var(--silk), var(--silk-2));
  color: var(--ink); border-top: 0; box-shadow: inset 0 3px 0 #b39a6a;
}
:root.hokuso:not([data-theme="light"]) .timeline { --silk: #3a372c; --silk-2: #2f2c23; --ink: #efe6cc; }
@media (prefers-color-scheme: light) { :root.hokuso:not([data-theme="dark"]) .timeline { --silk: #ece2c8; --silk-2: #e2d6b6; --ink: #2d2a22; } }
.hokuso .timeline::before, .hokuso .timeline::after { content: ''; position: absolute; top: 0; bottom: 0; width: 10px; background: linear-gradient(90deg, #3a2414, #7a5232 45%, #3a2414); z-index: 1; }
.hokuso .timeline::before { left: 0; border-radius: 0 4px 4px 0; }
.hokuso .timeline::after { right: 0; border-radius: 4px 0 0 4px; }
.hokuso .timeline .tl-gengo, .hokuso .timeline .tl-axis, .hokuso .timeline .tl-opts, .hokuso .timeline .tl-unit { color: color-mix(in srgb, var(--ink) 72%, transparent); }
.hokuso .tl-year { color: var(--ink); }
.hokuso .tl-btn { background: color-mix(in srgb, var(--silk) 80%, #fff); border-color: #b39a6a; color: var(--ink); }
.hokuso .tl-btn.play { background: #3f7f70; color: #f3ecd6; box-shadow: 0 3px 10px rgba(63,127,112,.35); }
.hokuso .tl-rail { background: color-mix(in srgb, var(--ink) 14%, transparent); height: 4px; }
.hokuso .tl-progress { background: linear-gradient(90deg, rgba(63,127,112,.25), #3f7f70); }
.hokuso .tl-eras div { font-family: var(--font-serif); }
.hokuso .tl-handle { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: radial-gradient(circle at 35% 35%, #bfe0d4, #6aa596 60%, #3f7f70); border: 2px solid #f3ecd6; box-shadow: 0 0 0 1px #3f7f70, 0 3px 10px rgba(0,0,0,.35); }
.hokuso .tl-handle span { background: #3f7f70; color: #f3ecd6; }
.hokuso .tl-opts select { background: var(--silk); color: var(--ink); }
/* ── 楚漢戦争：漢の漆器（黒漆に朱の雲気文）、半両銭の取っ手 ── */
.soukan { --accent: #c8412f; --accent-2: #e27a5e; --river: #6a98b8; }
:root.soukan[data-theme="light"] { --accent: #a8321f; --accent-2: #cf5a40; }
@media (prefers-color-scheme: light) { :root.soukan:not([data-theme="dark"]) { --accent: #a8321f; --accent-2: #cf5a40; } }
.soukan .brand-mark { border-radius: 50%; background: radial-gradient(circle, transparent 0 0), #b08a4a; color: transparent; position: relative;
  box-shadow: inset 0 0 0 2px #7a5a2a, 0 2px 10px rgba(0,0,0,.35); }
.soukan .brand-mark::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); background: #1c1512; box-shadow: 0 0 0 2px #7a5a2a; }
.soukan .timeline {
  --lq: #1c1512; --lq-2: #120d0b; --shu: #b8321f; --tl-ink: #f1e0c4;
  background:
    linear-gradient(var(--shu), var(--shu)) 0 0 / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(184,50,31,.55) 34px 36px) 0 3px / 100% 4px no-repeat,
    radial-gradient(14px 8px at 20px 100%, transparent 70%, rgba(184,50,31,.45) 72% 88%, transparent 90%) 0 100% / 60px 14px repeat-x,
    radial-gradient(14px 8px at 50px 0, transparent 70%, rgba(184,50,31,.35) 72% 88%, transparent 90%) 0 calc(100% - 4px) / 60px 14px repeat-x,
    linear-gradient(var(--lq), var(--lq-2));
  color: var(--tl-ink); border-top: 0;
}
.soukan .timeline .tl-gengo, .soukan .timeline .tl-axis, .soukan .timeline .tl-opts, .soukan .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 72%, transparent); }
.soukan .tl-year { color: #f6dcae; font-size: 32px; font-family: var(--font-serif); }
.soukan .tl-btn { background: #2a1e19; border-color: #7a3a2a; color: #f1e0c4; }
.soukan .tl-btn.play { background: #b8321f; border-color: #e0a070; color: #fff3de; box-shadow: 0 0 0 2px #1c1512, 0 0 0 3px #b8321f; }
.soukan .tl-rail { background: rgba(255,230,200,.12); height: 5px; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(184,50,31,.5); }
.soukan .tl-progress { background: linear-gradient(90deg, rgba(184,50,31,.2), #d9563c); }
.soukan .tl-eras div { color: #fff0d8; font-family: var(--font-serif); border-radius: 0; }
.soukan .tl-handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 0;
  background: linear-gradient(#1c1512, #1c1512) center / 8px 8px no-repeat, radial-gradient(circle, #d8b068 0 55%, #9a7434 57% 100%);
  box-shadow: inset 0 0 0 2px #7a5a2a, 0 0 0 1px #1c1512, 0 3px 12px rgba(0,0,0,.55); }
.soukan .tl-handle span { background: #b8321f; color: #fff3de; }
.soukan .tl-axis span::before { background: #b8321f; }
.soukan .tl-opts select { background: #2a1e19; color: #f1e0c4; border-color: #7a3a2a; }
.soukan .wm-year { font-size: clamp(48px, 7vw, 100px); }
.bt-troops .tori { fill: none; stroke: #2a2a2a; stroke-width: 1.5; stroke-linecap: round; animation: toriFlap .45s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes toriFlap { from { transform: scaleY(1); } to { transform: scaleY(-.6) translateY(-2px); } }
/* ── 源平合戦：紺地に金の霞（大和絵）、紅白の帯、扇の的の取っ手 ── */
.genpei { --accent: #c0392b; --accent-2: #e2735f; --river: #5f8fb8; }
:root.genpei[data-theme="light"] { --accent: #a8281c; --accent-2: #cc5a45; }
@media (prefers-color-scheme: light) { :root.genpei:not([data-theme="dark"]) { --accent: #a8281c; --accent-2: #cc5a45; } }
.genpei .brand-mark { border-radius: 4px; background: linear-gradient(90deg, #c0392b 0 50%, #ece6d6 50% 100%); color: transparent; box-shadow: inset 0 0 0 2px #b8913a, 0 2px 8px rgba(0,0,0,.3); }
.genpei .timeline {
  --kon: #1d2440; --kon-2: #151a30; --kin: rgba(226,186,98,.5); --tl-ink: #f3e7cc;
  background:
    linear-gradient(90deg, #c0392b 0 50%, #ece6d6 50% 100%) 0 0 / 100% 4px no-repeat,
    radial-gradient(60px 4px at 9% 12px, var(--kin) 70%, transparent 74%),
    radial-gradient(90px 5px at 16% 18px, var(--kin) 70%, transparent 74%),
    radial-gradient(80px 4px at 47% 11px, var(--kin) 70%, transparent 74%),
    radial-gradient(70px 4px at 78% 14px, var(--kin) 70%, transparent 74%),
    radial-gradient(100px 5px at 88% 20px, var(--kin) 70%, transparent 74%),
    linear-gradient(var(--kon), var(--kon-2));
  color: var(--tl-ink); border-top: 0;
}
.genpei .timeline .tl-gengo, .genpei .timeline .tl-axis, .genpei .timeline .tl-opts, .genpei .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 74%, transparent); }
.genpei .tl-year { color: #f6e3b0; font-family: var(--font-serif); }
.genpei .tl-btn { background: #262e50; border-color: #5a6390; color: #f3e7cc; }
.genpei .tl-btn.play { background: #c0392b; border-color: #e8c27a; color: #fff6e0; box-shadow: 0 0 0 2px #1d2440, 0 0 0 3px #b8913a; }
.genpei .tl-rail { background: rgba(255,255,255,.12); height: 5px; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(214,176,92,.4); }
.genpei .tl-progress { background: linear-gradient(90deg, rgba(236,230,214,.25), #ece6d6 55%, #c0392b); }
.genpei .tl-eras div { color: #fff4dc; font-family: var(--font-serif); border-radius: 0; }
.genpei .tl-handle { width: 30px; height: 17px; margin: -15px 0 0 -15px; border: 0; border-radius: 30px 30px 0 0 / 30px 30px 0 0;
  background: radial-gradient(circle at 50% 100%, #f1c64a 0 26%, transparent 27%), repeating-conic-gradient(from -90deg at 50% 100%, rgba(0,0,0,.14) 0 1deg, transparent 1deg 18deg), #c0392b;
  box-shadow: 0 0 0 2px #e8c27a, 0 4px 10px rgba(0,0,0,.5); }
.genpei .tl-handle span { background: #c0392b; color: #fff6e0; }
.genpei .tl-axis span::before { background: #b8913a; }
.genpei .tl-opts select { background: #262e50; color: #f3e7cc; border-color: #5a6390; }
/* ── 南北朝：墨色に青海波（せいがいは）、菊水の取っ手 ── */
.nanboku { --accent: #a8432f; --accent-2: #d0735c; --river: #5f8fb8; }
:root.nanboku[data-theme="light"] { --accent: #8f3322; --accent-2: #b85a44; }
@media (prefers-color-scheme: light) { :root.nanboku:not([data-theme="dark"]) { --accent: #8f3322; --accent-2: #b85a44; } }
.nanboku .brand-mark { border-radius: 50%; color: transparent; background: repeating-conic-gradient(#d9b45a 0 10deg, #a8432f 10deg 20deg); box-shadow: inset 0 0 0 5px #a8432f, 0 2px 8px rgba(0,0,0,.3); }
.nanboku .timeline {
  --sumi: #22252b; --sumi-2: #1a1c21; --wave: rgba(140, 170, 200, .16); --tl-ink: #ece5d3;
  background:
    radial-gradient(circle at 50% 100%, transparent 9px, var(--wave) 10px 11px, transparent 12px 15px, var(--wave) 16px 17px, transparent 18px) 0 100% / 36px 18px repeat-x,
    radial-gradient(circle at 50% 100%, transparent 9px, var(--wave) 10px 11px, transparent 12px 15px, var(--wave) 16px 17px, transparent 18px) 18px calc(100% - 9px) / 36px 18px repeat-x,
    linear-gradient(var(--sumi), var(--sumi-2));
  color: var(--tl-ink); border-top: 2px solid #a8432f;
}
.nanboku .timeline .tl-gengo, .nanboku .timeline .tl-axis, .nanboku .timeline .tl-opts, .nanboku .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 72%, transparent); }
.nanboku .tl-year { color: #f3e6c4; font-family: var(--font-serif); }
.nanboku .tl-btn { background: #2d3139; border-color: #4f5563; color: #ece5d3; }
.nanboku .tl-btn.play { background: #a8432f; border-color: #d9b45a; color: #fff4dc; }
.nanboku .tl-rail { background: rgba(255,255,255,.1); height: 4px; }
.nanboku .tl-progress { background: linear-gradient(90deg, rgba(58,79,120,.6), #a8432f); }
.nanboku .tl-eras div { color: #f6ecd6; font-family: var(--font-serif); border-radius: 0; }
.nanboku .tl-handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, #d9b45a 0 22%, transparent 24%), repeating-conic-gradient(#e6c36a 0 9deg, #a8432f 9deg 18deg);
  box-shadow: 0 0 0 2px #22252b, 0 0 0 3px #d9b45a, 0 3px 10px rgba(0,0,0,.5); }
.nanboku .tl-handle span { background: #a8432f; color: #fff4dc; }
.nanboku .tl-axis span::before { background: #6a7280; }
.nanboku .tl-opts select { background: #2d3139; color: #ece5d3; border-color: #4f5563; }
/* ── 飛鳥（壬申の乱・古代）：寺院の丹塗りの柱と緑青の連子窓、蓮華文の瓦の取っ手 ── */
.kodai { --accent: #b8453a; --accent-2: #d97a62; --river: #5f93b0; }
:root.kodai[data-theme="light"] { --accent: #9a3328; --accent-2: #c25c45; }
@media (prefers-color-scheme: light) { :root.kodai:not([data-theme="dark"]) { --accent: #9a3328; --accent-2: #c25c45; } }
.kodai .brand-mark { border-radius: 50%; color: transparent; background: radial-gradient(circle, #6b6358 0 18%, #8f877a 20% 34%, transparent 36%), repeating-conic-gradient(#b9b0a0 0 22.5deg, #8f877a 22.5deg 45deg); box-shadow: inset 0 0 0 3px #6b6358, 0 2px 8px rgba(0,0,0,.3); }
.kodai .timeline {
  --tan: #a8412f; --ryoku: #3f7a6a; --kabe: #efe6cf; --tl-ink: #2a221a;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--tan) 35%, transparent) 0 5px, transparent 5px) 0 0 / 150px 100%,
    repeating-linear-gradient(90deg, transparent 0 6px, color-mix(in srgb, var(--ryoku) 26%, transparent) 6px 9px) 14px 0 / 100% 7px no-repeat,
    linear-gradient(var(--tan), var(--tan)) 0 0 / 100% 4px no-repeat,
    linear-gradient(var(--kabe), #e6dab9);
  color: var(--tl-ink); border-top: 0;
}
:root.kodai:not([data-theme="light"]) .timeline { --kabe: #2f2a24; --tl-ink: #efe4c8; }
@media (prefers-color-scheme: light) { :root.kodai:not([data-theme="dark"]) .timeline { --kabe: #efe6cf; --tl-ink: #2a221a; } }
.kodai .timeline .tl-gengo, .kodai .timeline .tl-axis, .kodai .timeline .tl-opts, .kodai .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 72%, transparent); }
.kodai .tl-year { color: var(--tl-ink); font-family: var(--font-serif); }
.kodai .tl-btn { background: color-mix(in srgb, var(--kabe) 85%, #fff); border-color: #b5a07a; color: var(--tl-ink); }
.kodai .tl-btn.play { background: var(--tan); color: #fff4e0; border-color: #6b2a20; }
.kodai .tl-rail { background: color-mix(in srgb, var(--ryoku) 30%, transparent); height: 5px; border-radius: 0; }
.kodai .tl-progress { background: linear-gradient(90deg, rgba(63,122,106,.35), #3f7a6a); }
.kodai .tl-eras div { font-family: var(--font-serif); border-radius: 0; }
.kodai .tl-handle { width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, #6b6358 0 16%, #9a917f 18% 30%, transparent 32%), repeating-conic-gradient(#c9c0ad 0 22.5deg, #948b79 22.5deg 45deg);
  box-shadow: 0 0 0 2px #6b6358, 0 3px 10px rgba(0,0,0,.4); }
.kodai .tl-handle span { background: var(--tan); color: #fff4e0; }
.kodai .tl-opts select { background: var(--kabe); color: var(--tl-ink); }
.bt-troops .zou-body { fill: #7d7a74; stroke: #3a3834; stroke-width: .6; }
.bt-troops .zou-trunk { fill: none; stroke: #6a6760; stroke-width: 2.2; stroke-linecap: round; }
.bt-troops .zou-tusk { stroke: #efe8d8; stroke-width: 1.3; stroke-linecap: round; }
.bt-troops .zou-tower { fill: #b0864a; stroke: #4a3520; stroke-width: .5; }
/* ── アレクサンドロス東征：黒絵式の陶器（赤土に黒）、雷文（メアンダー）の帯、ドラクマ銀貨の取っ手 ── */
.alexander { --accent: #b85a2a; --accent-2: #dc8a55; --river: #5f93b8; }
:root.alexander[data-theme="light"] { --accent: #9a4520; --accent-2: #c46a3a; }
@media (prefers-color-scheme: light) { :root.alexander:not([data-theme="dark"]) { --accent: #9a4520; --accent-2: #c46a3a; } }
.alexander .brand-mark { border-radius: 50%; background: radial-gradient(circle, #d8d4ca 0 58%, #9a968c 60% 100%); color: #3a3a3a; box-shadow: inset 0 0 0 2px #7a766c, 0 2px 8px rgba(0,0,0,.3); }
.alexander .timeline {
  --terra: #c46a38; --terra-2: #a8552a; --kuro: #1e1a17; --tl-ink: #1e1a17;
  background:
    linear-gradient(90deg, var(--kuro) 0 2px, transparent 2px 10px, var(--kuro) 10px 12px, transparent 12px) 0 0 / 24px 3px repeat-x,
    linear-gradient(var(--kuro) 0 2px, transparent 2px) 0 3px / 24px 7px repeat-x,
    linear-gradient(90deg, transparent 0 4px, var(--kuro) 4px 6px, transparent 6px 16px, var(--kuro) 16px 18px, transparent 18px) 0 5px / 24px 5px repeat-x,
    linear-gradient(var(--kuro), var(--kuro)) 0 10px / 100% 2px no-repeat,
    linear-gradient(var(--terra), var(--terra-2));
  color: var(--tl-ink); border-top: 0;
}
.alexander .timeline .tl-gengo, .alexander .timeline .tl-axis, .alexander .timeline .tl-opts, .alexander .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 80%, transparent); }
.alexander .tl-year { color: #1e1a17; font-family: var(--font-serif); }
.alexander .tl-btn { background: #d88a55; border-color: #1e1a17; color: #1e1a17; }
.alexander .tl-btn.play { background: #1e1a17; color: #e8a070; border-color: #1e1a17; border-radius: 50%; }
.alexander .tl-rail { background: rgba(30,26,23,.25); height: 4px; border-radius: 0; }
.alexander .tl-progress { background: linear-gradient(90deg, rgba(30,26,23,.2), #1e1a17); }
.alexander .tl-eras div { font-family: var(--font-serif); border-radius: 0; }
.alexander .tl-handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f4f1ea, #c9c4b8 55%, #8f8a7e); box-shadow: 0 0 0 1px #5a564d, 0 3px 10px rgba(0,0,0,.45); }
.alexander .tl-handle::after { content: 'Α'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 12px var(--font-serif); color: #5a564d; }
.alexander .tl-handle span { background: #1e1a17; color: #e8a070; }
.alexander .tl-opts select { background: #d88a55; color: #1e1a17; border-color: #1e1a17; }
/* ── ポエニ戦争：ローマのモザイク床（石の粒と赤い縁取り）、デナリウス銀貨の取っ手 ── */
.punic { --accent: #a8322a; --accent-2: #d06a55; --river: #5f93b8; }
:root.punic[data-theme="light"] { --accent: #8f2a22; --accent-2: #b85644; }
@media (prefers-color-scheme: light) { :root.punic:not([data-theme="dark"]) { --accent: #8f2a22; --accent-2: #b85644; } }
.punic .brand-mark { border-radius: 4px; background: #a8322a; color: #f1d98a; box-shadow: inset 0 0 0 2px #f1d98a, 0 2px 8px rgba(0,0,0,.3); }
.punic .timeline {
  --stone: #e9e1cf; --stone-2: #ddd2ba; --tl-ink: #2a221a;
  background:
    linear-gradient(90deg, #1f1a16 0 100%) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, #a8322a 0 6px, #e9e1cf 6px 7px, #1f1a16 7px 13px, #e9e1cf 13px 14px) 0 2px / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, rgba(90,70,40,.09) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(90,70,40,.09) 0 1px, transparent 1px 7px),
    linear-gradient(var(--stone), var(--stone-2));
  color: var(--tl-ink); border-top: 0;
}
:root.punic:not([data-theme="light"]) .timeline { --stone: #2c2822; --stone-2: #24211c; --tl-ink: #eee4cc; }
@media (prefers-color-scheme: light) { :root.punic:not([data-theme="dark"]) .timeline { --stone: #e9e1cf; --stone-2: #ddd2ba; --tl-ink: #2a221a; } }
.punic .timeline .tl-gengo, .punic .timeline .tl-axis, .punic .timeline .tl-opts, .punic .timeline .tl-unit { color: color-mix(in srgb, var(--tl-ink) 75%, transparent); }
.punic .tl-year { color: var(--tl-ink); font-family: var(--font-serif); letter-spacing: .04em; }
.punic .tl-btn { background: color-mix(in srgb, var(--stone) 80%, #fff); border-color: #8a7a5a; color: var(--tl-ink); border-radius: 2px; }
.punic .tl-btn.play { background: #a8322a; color: #f1d98a; border-color: #5a1a14; border-radius: 2px; }
.punic .tl-rail { background: color-mix(in srgb, var(--tl-ink) 18%, transparent); height: 5px; border-radius: 0; }
.punic .tl-progress { background: linear-gradient(90deg, rgba(168,50,42,.25), #a8322a); }
.punic .tl-eras div { font-family: var(--font-serif); border-radius: 0; }
.punic .tl-handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f6f2e8, #cfc8b8 55%, #948d7e); box-shadow: 0 0 0 1px #5a564d, 0 3px 10px rgba(0,0,0,.45); }
.punic .tl-handle::after { content: 'R'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 12px var(--font-serif); color: #5a564d; }
.punic .tl-handle span { background: #a8322a; color: #f1d98a; }
.punic .tl-opts select { background: var(--stone); color: var(--tl-ink); }

/* ==== スマホの調整（mobile.js と組） ==== */
.pop-tg { font: inherit; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; opacity: .75; cursor: pointer; white-space: nowrap; flex: none; }
.pop-tg[aria-pressed="true"] { background: var(--accent, #8a3b22); border-color: var(--accent, #8a3b22); color: #fff; opacity: 1; }
@media (max-width: 860px) {
  .toast { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; transform: none; padding: 7px 12px 8px; animation-name: toastInM; }
  .toast .t-date { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast .t-title { font-size: 15px; margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast .t-desc, .toast .anim-box { display: none; }
  .pop-tg { padding: 4px 9px; }
}
@keyframes toastInM { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
