/* 第一次世界大戦 勢力図 ─ 太平洋戦争 勢力図のスタイルに、塹壕・野戦地図風の配色を重ねる（末尾の「第一次世界大戦版」） */
:root {
  --paper: #f1eadb;
  --paper-2: #e7dcc6;
  --card: #f8f3e8;
  --ink: #26221c;
  --ink-2: #5e5647;
  --ink-3: #8b8271;
  --line: #cdbf9f;
  --line-2: #b3a37f;
  --sea-a: #b4c5c6;
  --sea-b: #a3b7ba;
  --grat: rgba(45, 70, 80, .16);
  --ctx: #ddd3bc;
  --ctx-line: #a99c7f;
  --border: rgba(40, 32, 22, .5);
  --unk: #d8cfba;
  --front: #b0201a;
  --accent: #a82b24;
  --accent-ink: #fff;
  --navy: #1d2a36;
  --shadow: 0 6px 24px rgba(40, 30, 10, .16);
  --radius: 10px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', serif;
  --sans: 'Noto Sans JP', system-ui, sans-serif;
  /* 戦闘アニメ */
  --bt-sea-a: #9fb6bc;
  --bt-sea-b: #86a0a8;
  --bt-land: #d7cba9;
  --bt-land-line: #8d7f5c;
  --bt-grid: rgba(20, 40, 50, .13);
  --bt-ink: #1f2a30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161c22; --paper-2: #1d252d; --card: #1f2830; --ink: #ece4d2; --ink-2: #b9b09c; --ink-3: #857d6d;
    --line: #34404b; --line-2: #47525d; --sea-a: #1b2c38; --sea-b: #142430; --grat: rgba(170, 200, 210, .09);
    --ctx: #2b3033; --ctx-line: #454a4c; --border: rgba(10, 12, 14, .7); --unk: #3a3f42; --front: #ff5a4a;
    --accent: #c9453b; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
    --bt-sea-a: #1d3440; --bt-sea-b: #152833; --bt-land: #3b3a32; --bt-land-line: #6d6754; --bt-grid: rgba(170, 210, 220, .08); --bt-ink: #e6ddc8;
  }
}
:root[data-theme="dark"] {
  --paper: #161c22; --paper-2: #1d252d; --card: #1f2830; --ink: #ece4d2; --ink-2: #b9b09c; --ink-3: #857d6d;
  --line: #34404b; --line-2: #47525d; --sea-a: #1b2c38; --sea-b: #142430; --grat: rgba(170, 200, 210, .09);
  --ctx: #2b3033; --ctx-line: #454a4c; --border: rgba(10, 12, 14, .7); --unk: #3a3f42; --front: #ff5a4a;
  --accent: #c9453b; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --bt-sea-a: #1d3440; --bt-sea-b: #152833; --bt-land: #3b3a32; --bt-land-line: #6d6754; --bt-grid: rgba(170, 210, 220, .08); --bt-ink: #e6ddc8;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.7 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
kbd { font: 12px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }

.app { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh; }

/* ── ヘッダー ── */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--navy); color: #efe6d2; border-bottom: 3px solid #a82b24; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 2px solid #d9c9a3; position: relative;
  background: radial-gradient(circle, #c8372d 0 5px, transparent 5.5px), linear-gradient(#d9c9a3, #d9c9a3) center/1.5px 100% no-repeat, linear-gradient(#d9c9a3, #d9c9a3) center/100% 1.5px no-repeat; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-title { font: 800 21px/1.2 var(--serif); letter-spacing: .06em; white-space: nowrap; }
.brand-sub { font-size: 11.5px; opacity: .72; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theater { display: flex; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: 3px; gap: 2px; flex: none; }
.theater a { color: #efe6d2; text-decoration: none; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 6px; opacity: .62; }
.theater a:hover { opacity: 1; }
.theater a.on { background: #a82b24; opacity: 1; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.toggles { display: flex; gap: 2px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 3px; }
.tg { display: inline-flex; cursor: pointer; user-select: none; }
.tg input { position: absolute; opacity: 0; pointer-events: none; }
.tg span { padding: 3px 11px; border-radius: 999px; font-size: 13px; opacity: .6; transition: .15s; }
.tg input:checked + span { background: rgba(255, 255, 255, .16); opacity: 1; }
.tg input:focus-visible + span { outline: 2px solid #e0c98f; }
.btn { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; line-height: 1.3; }
.btn:hover { border-color: var(--ink-3); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.accent:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; border-radius: 8px; padding: 9px 14px; margin-top: 10px; }
.topbar .btn:not(.accent) { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .2); color: #efe6d2; }
.btn.icon { width: 34px; height: 34px; padding: 0; }
.short { display: none; }

/* ── レイアウト ── */
.layout { display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.map-wrap { position: relative; overflow: hidden; background: var(--sea-b); min-height: 0; }
#map { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.panel { border-left: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; min-height: 0; }

/* ── 地図 ── */
.sea { fill: url(#sea-g); }
.sea-a { stop-color: var(--sea-a); } .sea-b { stop-color: var(--sea-b); }
.grat { fill: none; stroke: var(--grat); stroke-width: .8; vector-effect: non-scaling-stroke; }
.ctx { fill: var(--ctx); stroke: var(--ctx-line); stroke-width: .5; vector-effect: non-scaling-stroke; }
.reg { stroke: none; cursor: pointer; transition: fill .45s, opacity .25s; }
.reg:hover { filter: brightness(1.12) saturate(1.1); }
.reg.dim, .isle.dim { opacity: .25; }
.borders { fill: none; stroke: var(--border); stroke-width: .55; vector-effect: non-scaling-stroke; pointer-events: none; }
.front { fill: none; stroke: var(--front); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.front-glow { fill: none; stroke: #fff6; stroke-width: 5.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.sel-outline { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.isle { cursor: pointer; }
.isle-ring { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .55; }
.isle-dot { stroke: var(--paper); stroke-width: 1.4; transition: fill .45s; }
.isle.contested .isle-ring { stroke: var(--front); stroke-width: 2; opacity: 1; stroke-dasharray: 3 2; }
.grat-lab text { font: 500 9.5px var(--mono); fill: var(--ink-3); text-anchor: middle; pointer-events: none; opacity: .8; }
.reg-labels { display: none; pointer-events: none; }
.reg-labels.on { display: block; }
.reg-labels text { font-size: calc(9.5px / var(--k, 1)); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: calc(2.4px / var(--k, 1)); stroke-linejoin: round; opacity: .85; }
.fac-labels text { font: 800 16px var(--serif); fill: #fff; paint-order: stroke; stroke: rgba(25, 18, 10, .78); stroke-width: 3.2px; stroke-linejoin: round;
  text-anchor: middle; dominant-baseline: middle; cursor: pointer; letter-spacing: .08em; transform-box: fill-box; }
#map { --k: 1; --lk: 1; }
.fac-labels text { font-size: calc(var(--fsb, 16px) * var(--lk)); stroke-width: calc(3.2px * var(--lk)); }

.ev { cursor: pointer; }
.ev-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.ev.imp .ev-dot { fill: #fff8e8; stroke: var(--front); stroke-width: 2; }
.ev-g { font-size: 11px; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.ev.k-civ .ev-g { fill: #8a1d17; }
.ev-pulse { fill: none; stroke: var(--front); stroke-width: 2; opacity: 0; }
.ev:not(.old) .ev-pulse { animation: pulse 1.8s ease-out infinite; }
.ev.old { opacity: .5; }
@keyframes pulse { 0% { r: 9; opacity: .9; } 100% { r: 22; opacity: 0; } }

.watermark { position: absolute; left: 18px; top: 12px; pointer-events: none; }
.wm-row { display: flex; align-items: baseline; gap: 8px; }
.wm-year { font: 800 60px/1 var(--serif); letter-spacing: -.01em; color: var(--ink); text-shadow: 0 2px 0 var(--paper-2); }
.wm-month { font: 800 30px/1 var(--serif); color: var(--ink); }
.wm-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.wm-era { color: #fff; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px; }
.map-legend { position: absolute; left: 14px; bottom: 12px; right: 70px; display: flex; flex-wrap: wrap; gap: 4px 6px; pointer-events: none; }
.lg { pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 8px 1px 5px; background: color-mix(in srgb, var(--paper) 88%, transparent); border: 1px solid var(--line); border-radius: 999px; cursor: default; }
button.lg { cursor: pointer; }
.lg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-hatch { background: repeating-linear-gradient(45deg, #b8322a 0 3px, #4d8a5c 3px 6px); }
.lg-front { height: 3px !important; width: 16px !important; background: var(--front); border-radius: 2px !important; }
.map-ctrl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 17px; box-shadow: var(--shadow); }
.tooltip { position: absolute; left: 0; top: 0; max-width: 280px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.55; box-shadow: var(--shadow); pointer-events: none; z-index: 5; }
.tt-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tt-note { margin-top: 4px; color: var(--ink-2); font-size: 12px; border-top: 1px dashed var(--line); padding-top: 4px; }
.toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: var(--navy); color: #f3ead6; padding: 8px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); z-index: 6; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.touch-hint { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); background: rgba(0, 0, 0, .7); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; }

/* ── パネル ── */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tabs button { background: none; border: 0; padding: 11px 4px 9px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-3); border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel-body, .detail { overflow-y: auto; padding: 16px 18px 28px; flex: 1; min-height: 0; }
.detail-back { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; margin-bottom: 8px; font-weight: 700; }
.era-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--era); border-radius: var(--radius); padding: 12px 14px; }
.era-card h2 { font: 800 21px/1.35 var(--serif); margin: 2px 0 6px; }
.era-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.era-range { font: 500 11.5px var(--mono); color: var(--ink-3); }
.sec { font-size: 12px; letter-spacing: .12em; color: var(--ink-3); margin: 20px 0 8px; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.sec.year { font: 800 17px var(--serif); letter-spacing: .02em; color: var(--ink); position: sticky; top: -16px; background: var(--paper); z-index: 1; padding-top: 6px; }
.sec.year small { font: 500 12px var(--sans); color: var(--ink-3); margin-left: 6px; }
.muted { color: var(--ink-3); } .small { font-size: 12.5px; }
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-li { display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.ev-li:hover { background: var(--paper-2); }
.ev-li.now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ev-li.past { opacity: .62; }
.ev-ico { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-size: 12px; margin-top: 1px; background: var(--card); }
.ev-li.imp .ev-ico { border-color: var(--front); }
.k-civ .ev-ico { color: #8a1d17; }
.ev-body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.ev-date { font: 500 11.5px var(--mono); color: var(--ink-3); }
.ev-name { font-weight: 700; font-size: 14px; }
.ev-li.imp .ev-name { color: var(--accent); }
.ev-anim { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 7px; align-self: center; }
.ev-filter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.chip { display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; opacity: .45; }
.chip input:checked + span { opacity: 1; background: var(--card); }
.stat-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.stat-big { font: 800 32px/1.1 var(--serif); }
.stat-unit { font-size: 13px; color: var(--ink-2); }
.stat-note { flex-basis: 100%; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.spark { margin-top: 8px; cursor: pointer; }
.sp-area { fill: #b8322a; opacity: .22; }
.sp-line { fill: none; stroke: #b8322a; stroke-width: 1.8; }
.sp-now { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 2; }
.sp-dot { fill: #b8322a; stroke: var(--paper); stroke-width: 1.5; }
.sp-tick { stroke: var(--ink-3); }
.sp-lab { font: 500 9.5px var(--mono); fill: var(--ink-3); text-anchor: middle; }
.fac-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 2px 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.fac-row:hover { background: var(--paper-2); }
.fac-sw { width: 14px; height: 14px; border-radius: 3px; }
.fac-n { font-weight: 700; font-size: 13.5px; }
.fac-v { font: 500 13px var(--mono); }
.fac-v small { font: 400 10.5px var(--sans); color: var(--ink-3); margin-left: 2px; }
.fac-bar { grid-column: 2 / 4; height: 4px; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.fac-bar i { display: block; height: 100%; opacity: .8; }
.kicker { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .1em; }
.detail h2 { font: 800 23px/1.35 var(--serif); margin: 2px 0 8px; display: flex; align-items: center; gap: 8px; }
.detail h2 .sw { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.now-ctrl { margin: 0 0 8px; }
.tag { display: inline-block; background: var(--c); color: #fff; padding: 0 8px; border-radius: 5px; font-weight: 700; font-size: 13px; margin: 0 2px; }
.vs { font-size: 13px; }
.note-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: 13.5px; margin: 0; }
.hist { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.hist li { position: relative; padding: 5px 8px 7px; cursor: pointer; border-radius: 6px; display: flex; flex-direction: column; }
.hist li::before { content: ''; position: absolute; left: -18px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-2); }
.hist li.on::before { background: var(--accent); border-color: var(--accent); }
.hist li:hover { background: var(--paper-2); }
.h-date { font: 500 11.5px var(--mono); color: var(--ink-3); }
.h-f { font-weight: 700; font-size: 14px; }
.h-f i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.h-note { font-size: 12.5px; color: var(--ink-2); }
.reg-list { margin: 0; padding-left: 18px; columns: 2; font-size: 13.5px; }
.ev-when { font: 500 13px var(--mono); color: var(--ink-2); margin-bottom: 4px; }
.ev-text { font-size: 14.5px; line-height: 1.85; }
.alt { font-size: 13px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 8px; padding: 7px 10px; }
.alt span { font-weight: 700; background: var(--ink-2); color: var(--paper); border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: 11.5px; }
.bt-card { display: grid; gap: 2px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  background-image: repeating-linear-gradient(0deg, transparent 0 18px, var(--grat) 18px 19px), repeating-linear-gradient(90deg, transparent 0 18px, var(--grat) 18px 19px); }
.bt-card:hover { border-color: var(--accent); }
.bt-card-k { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.bt-card-t { font: 800 19px/1.3 var(--serif); }
.bt-card-d { font: 500 12px var(--mono); color: var(--ink-3); }
.bt-card-l { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.anim-list { padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 12px; overflow-y: auto; }

/* ── 年表（作戦記録テープ）── */
.timeline { --tl-bg: #121b24; --tl-ink: #eae1cc; --tl-dim: #8d9aa6; --tl-line: #2c3a47; --tl-red: #e0483b;
  background: linear-gradient(#17222d, var(--tl-bg)); color: var(--tl-ink); border-top: 3px solid var(--tl-red);
  padding: 8px 18px 4px; user-select: none; position: relative; }
.tl-top { display: flex; align-items: center; gap: 16px; }
.tl-buttons { display: flex; align-items: center; gap: 5px; }
.tl-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--tl-line); background: #1b2733; color: var(--tl-ink); cursor: pointer; font-size: 11px; }
.tl-btn:hover { border-color: var(--tl-dim); }
.tl-btn.play { width: 46px; height: 38px; background: var(--tl-red); color: #fff; border: 0; font-size: 15px; border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(224, 72, 59, .18), 0 4px 12px rgba(0, 0, 0, .35); }
.tl-counter { display: flex; align-items: baseline; gap: 3px; font-family: var(--mono); }
.cnt-box { display: inline-block; overflow: hidden; background: #0b1117; border: 1px solid var(--tl-line); border-radius: 5px; padding: 1px 7px;
  box-shadow: inset 0 -10px 12px rgba(255, 255, 255, .03), inset 0 1px 0 rgba(255, 255, 255, .05); }
.cnt { display: inline-block; font: 500 24px/1.15 var(--mono); letter-spacing: .04em; color: #ffe7b8; }
.cnt.roll { animation: roll .38s cubic-bezier(.2, .8, .3, 1); }
@keyframes roll { 0% { transform: translateY(-70%); opacity: 0; filter: blur(1px); } 100% { transform: none; opacity: 1; } }
.cnt-dot { font-size: 12px; color: var(--tl-dim); margin-right: 3px; }
.tl-sub { display: flex; flex-direction: column; line-height: 1.3; }
.tl-showa { font-size: 11.5px; color: var(--tl-dim); }
.tl-era { font-size: 12.5px; font-weight: 700; color: #fff; }
.tl-era::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--ec, #888); margin-right: 5px; }
.tl-opts { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--tl-dim); }
.tl-opts select { font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--tl-line); background: #1b2733; color: var(--tl-ink); margin-left: 4px; }
.tl-opts .tg span { opacity: 1; padding: 0 0 0 20px; position: relative; font-size: 12px; color: var(--tl-dim); }
.tl-opts .tg span::before { content: ''; position: absolute; left: 0; top: 2px; width: 13px; height: 13px; border: 1.5px solid var(--tl-dim); border-radius: 3px; }
.tl-opts .tg input:checked + span { background: none; }
.tl-opts .tg input:checked + span::before { background: var(--tl-red); border-color: var(--tl-red); box-shadow: inset 0 0 0 2px var(--tl-bg); }
.tl-track { position: relative; height: 62px; margin-top: 7px; cursor: crosshair; touch-action: none; outline: none; }
.tl-track:focus-visible { outline: 2px solid var(--tl-red); outline-offset: 3px; border-radius: 4px; }
.tl-eralabs { position: absolute; left: 0; right: 0; top: 0; height: 13px; }
.tl-eralabs span { position: absolute; top: 0; height: 13px; font-size: 9.5px; line-height: 13px; color: var(--tl-dim); padding-left: 5px; white-space: nowrap; overflow: hidden;
  border-left: 1px solid var(--tl-line); transition: color .3s; }
.tl-eralabs span::before { content: ''; position: absolute; left: 0; right: 2px; bottom: 0; height: 2px; background: var(--ec); opacity: .45; }
.tl-eralabs span.on { color: #fff; font-weight: 700; }
.tl-eralabs span.on::before { opacity: 1; }
.tl-plot { position: absolute; left: 0; right: 0; top: 15px; bottom: 0; background: #0d141b; border: 1px solid var(--tl-line); border-radius: 4px; overflow: hidden; }
.tl-chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-area { fill: url(#tl-g); }
.tl-line { fill: none; stroke: var(--tl-red); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.tl-sep { stroke: #3b4a58; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.tl-future { position: absolute; top: 0; bottom: 0; right: 0; background: rgba(8, 12, 17, .62);
  background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .025) 5px 6px); transition: left .18s; }
.tl-ruler { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; pointer-events: none;
  background: linear-gradient(90deg, rgba(234, 225, 204, .35) 1px, transparent 1px) 0 0 / calc(100% / 99) 100% repeat-x; }
.tl-evs { position: absolute; left: 0; right: 0; top: 3px; height: 10px; pointer-events: none; }
.tl-ev { position: absolute; top: 2px; width: 5px; height: 5px; background: #9fb0bf; transform: translateX(-50%) rotate(45deg); opacity: .7; }
.tl-ev.imp { top: 0; width: 7px; height: 7px; background: #ffd27a; opacity: 1; box-shadow: 0 0 4px rgba(255, 210, 122, .6); }
.tl-cursor { position: absolute; top: 12px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px 1px rgba(255, 90, 70, .9); transition: left .18s; pointer-events: none; }
.tl-cursor::before { content: ''; position: absolute; top: -1px; left: -5px; border: 6px solid transparent; border-top: 7px solid #fff; border-bottom: 0; }
.tl-cursor span { position: absolute; bottom: -18px; left: 0; font: 500 10.5px var(--mono); background: var(--tl-red); color: #fff; padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.tl-hover { position: absolute; bottom: 52px; transform: translateX(-50%); background: #f4ecd9; color: #1d2a36; font-size: 12px; line-height: 1.45; padding: 4px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); z-index: 3; }
.tl-hover::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: #f4ecd9; border-bottom: 0; }
.tl-axis { position: relative; height: 20px; font: 500 10.5px var(--mono); color: var(--tl-dim); margin-top: 3px; }
.tl-axis span { position: absolute; transform: translateX(-50%); top: 3px; }
.tl-caption { position: absolute; right: 18px; bottom: 4px; font-size: 10px; color: var(--tl-dim); }
body.camp-on .timeline { box-shadow: inset 0 3px 0 #ffd27a; }

/* ── 進軍ルート ── */
.camp-player { position: absolute; left: 14px; bottom: 14px; width: min(370px, calc(100% - 28px)); background: color-mix(in srgb, var(--paper) 94%, transparent);
  border: 1px solid var(--line-2); border-top: 4px solid #ffd27a; border-radius: 12px; padding: 11px 14px 12px; box-shadow: var(--shadow); z-index: 4; backdrop-filter: blur(4px); }
.cp-head { display: flex; align-items: flex-start; gap: 8px; }
.cp-kicker { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; }
.camp-player h3 { font: 800 18px/1.3 var(--serif); margin: 0; }
.cp-x { margin-left: auto; background: none; border: 1px solid var(--line-2); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; flex: none; }
.cp-lead { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 6px; line-height: 1.55; }
.cp-routes { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 11.5px; margin-bottom: 4px; }
.cp-chip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; }
.cp-date { font: 800 22px/1.3 var(--serif); }
.cp-text { font-size: 13px; line-height: 1.6; min-height: 3.2em; }
.cp-text.flash { animation: cpflash .6s ease; }
@keyframes cpflash { 0% { background: rgba(255, 210, 122, .55); } 100% { background: transparent; } }
.cp-when { font: 500 11px var(--mono); color: var(--ink-3); margin-left: 6px; }
.cp-bar { height: 6px; background: var(--paper-2); border-radius: 3px; margin: 8px 0; cursor: pointer; overflow: hidden; }
.cp-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d9a33a, #e0483b); }
.cp-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cp-ctrl > button:not(.btn) { width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 12px; }
.cp-ctrl .cp-play { background: var(--accent); color: #fff; border: 0; }
.cp-ctrl .btn { font-size: 12px; padding: 5px 10px; }
.camp-layer { pointer-events: none; }
.cr-bg { fill: none; stroke: var(--c); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .5; vector-effect: non-scaling-stroke; }
.cr-line { fill: none; stroke: var(--c); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }
.kind-fleet .cr-line { stroke-width: 2.8; }
.kind-air .cr-line { stroke-width: 2; }
.cr-step { opacity: 0; transition: opacity .4s; }
.cr-step.on { opacity: 1; }
.cr-step circle { fill: var(--paper); stroke: var(--c); stroke-width: 2; }
.cr-step text { font: 700 11px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.cr-head.off { display: none; }
.cr-disc { fill: var(--c); stroke: #fff; stroke-width: 2; }
.cr-pulse { fill: none; stroke: var(--c); stroke-width: 2; animation: crp 1.4s ease-out infinite; }
@keyframes crp { 0% { r: 10; opacity: .9; } 100% { r: 24; opacity: 0; } }
.cr-icon { fill: #fff; }
.cr-name { font: 800 11.5px var(--sans); fill: var(--c); text-anchor: middle; paint-order: stroke; stroke: var(--paper); stroke-width: 3.5px; stroke-linejoin: round; }
.btn.camp { background: #2b3a48; border-color: #2b3a48; color: #ffe7b8; font-weight: 700; }
.bt-card.camp { border-left: 4px solid #ffd27a; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 12px; }
.sec small { font-weight: 500; letter-spacing: 0; margin-left: 6px; }

/* ── 月が変わるときの演出 ── */
.front { stroke-dasharray: 9 4; animation: march 1.1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -26; } }
.front-glow { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.chg-fx { pointer-events: none; }
.chg-flash { fill: var(--c); fill-opacity: 0; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; animation: flash 1.5s ease-out forwards; }
@keyframes flash { 0% { fill-opacity: .75; stroke-opacity: 1; } 100% { fill-opacity: 0; stroke-opacity: 0; } }
.chg-arrow path:first-child { fill: none; stroke: var(--c); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset .75s cubic-bezier(.3, .7, .3, 1); filter: drop-shadow(0 0 2px #fff) drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.chg-head { fill: var(--c); stroke: #fff; stroke-width: 1; opacity: 0; animation: headin .3s .6s forwards; }
@keyframes headin { to { opacity: 1; } }
.chg-arrow { transition: opacity .8s; }
.chg-arrow.out { opacity: 0; }
.chg-ring { fill: none; stroke: var(--c); stroke-width: 3; vector-effect: non-scaling-stroke; animation: chgring 1.6s ease-out forwards; }
@keyframes chgring { 0% { r: 2; opacity: 1; } 100% { r: 30; opacity: 0; } }
.chg-label text { font: 800 12.5px var(--sans); fill: var(--c); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chg-label { animation: rise 2.6s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; translate: 0 6px; } 12% { opacity: 1; translate: 0 0; } 75% { opacity: 1; } 100% { opacity: 0; translate: 0 -16px; } }
.ev-in { transform-box: fill-box; transform-origin: center; }
.ev.pop .ev-in { 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: #ff9b2f; stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.ev.pop .ev-burst { animation: burst .8s ease-out; }
@keyframes burst { 0% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.5); } }
.wm-year.roll, .wm-month.roll { animation: roll .45s cubic-bezier(.2, .8, .3, 1); display: inline-block; }

/* ── モーダル ── */
.modal { position: fixed; inset: 0; background: rgba(12, 16, 20, .55); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.modal-box { background: var(--paper); border-radius: 14px; width: min(640px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); overflow: hidden; }
.modal-box.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { font: 800 20px/1.3 var(--serif); margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.modal-head h2 small { font: 500 12.5px var(--sans); color: var(--ink-3); }
.modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 18px; flex: none; }
.about { padding: 6px 22px 22px; overflow-y: auto; font-size: 14px; }
.about h3 { font: 800 16px var(--serif); margin: 18px 0 4px; }
.about ul { padding-left: 20px; margin: 0; }
.about li { margin: 3px 0; }

/* ── 戦闘アニメ ── */
.battle-box { width: min(1320px, 100%); height: calc(100dvh - 32px); }
.bt-sides { display: flex; gap: 6px; flex-wrap: wrap; }
.bt-side-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px 1px 5px; background: var(--card); }
.bt-side-chip i { width: 10px; height: 10px; border-radius: 50%; }
.bt-body { display: grid; grid-template-columns: 1fr 340px; flex: 1; min-height: 0; }
.bt-stage { position: relative; background: var(--bt-sea-b); min-height: 0; overflow: hidden; }
#bt-svg { width: 100%; height: 100%; display: block; }
.bt-side { border-left: 1px solid var(--line); padding: 16px 18px; overflow-y: auto; }
.bt-time { font: 500 13px var(--mono); color: var(--accent); }
.bt-head { font: 800 21px/1.35 var(--serif); margin: 2px 0 8px; }
.bt-text { font-size: 14px; line-height: 1.85; margin: 0 0 12px; min-height: 5.5em; }
.bt-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bt-count { font: 500 13px var(--mono); color: var(--ink-3); }
.bt-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 12px; }
.bt-steps button { text-align: left; font-size: 12px; line-height: 1.35; border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 5px 7px; cursor: pointer; display: flex; gap: 6px; }
.bt-steps button b { font: 500 11px var(--mono); color: var(--ink-3); flex: none; }
.bt-steps button[aria-current="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.bt-side .note { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin-top: 12px; }
.bt-clock { position: absolute; left: 14px; top: 12px; font: 500 13px var(--mono); background: color-mix(in srgb, var(--paper) 85%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; pointer-events: none; }
.bt-legend { position: absolute; left: 12px; bottom: 10px; right: 12px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.bt-lg { display: inline-flex; align-items: center; gap: 2px; background: color-mix(in srgb, var(--paper) 86%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 1px 8px 1px 2px; font-size: 11px; }
.bt-lg svg { width: 30px; height: 30px; }

/* 戦闘図の中身 */
.bt-sea { fill: url(#bt-sea-g); }
.bt-sea-a { stop-color: var(--bt-sea-a); } .bt-sea-b { stop-color: var(--bt-sea-b); }
.bt-grid { stroke: var(--bt-grid); stroke-width: 1; fill: none; }
.bt-map { transition: opacity .8s; }
.bt-map.off { opacity: 0; pointer-events: none; }
.bt-land { fill: var(--bt-land); stroke: var(--bt-land-line); stroke-width: 1.2; stroke-linejoin: round; }
.bt-water { fill: var(--bt-sea-a); }
.bt-river { fill: none; stroke: var(--bt-sea-a); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fx-zone ellipse { fill: color-mix(in srgb, var(--zc) 12%, transparent); stroke: var(--zc); stroke-width: 2.5; stroke-dasharray: 8 5; animation: zonein .8s ease-out; }
.fx-zone text { font: 800 13px var(--sans); fill: var(--zc); text-anchor: middle; paint-order: stroke; stroke: var(--bt-land); stroke-width: 3.5px; }
@keyframes zonein { from { opacity: 0; transform: scale(1.3); transform-box: fill-box; transform-origin: center; } }
.bt-reef { fill: none; stroke: #e9f2ee; stroke-width: 2; stroke-dasharray: 2 3; opacity: .8; }
.bt-maplab { font: 700 14px var(--serif); fill: var(--bt-ink); opacity: .72; text-anchor: middle; letter-spacing: .15em; }
.bt-maplab.small { font: 500 11px var(--sans); letter-spacing: .02em; opacity: .75; }
.bt-maplab.sea { font-style: italic; fill: #2d4a55; opacity: .55; }
:root[data-theme="dark"] .bt-maplab.sea { fill: #9fc3cf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bt-maplab.sea { fill: #9fc3cf; } }
.bt-scale { font: 500 11px var(--sans); fill: var(--bt-ink); opacity: .6; }
.bt-arrow { fill: none; stroke-width: 2.4; stroke-dasharray: 7 5; opacity: .85; animation: dash 1.2s linear infinite; }
.bt-arrow.jp { stroke: #d63a2c; } .bt-arrow.us { stroke: #2d63c4; }
@keyframes dash { to { stroke-dashoffset: -24; } }

.u { transition: opacity .6s; }
.u.gone { opacity: 0; }
.u .glow { opacity: .0; }
.u.sel .glow { opacity: .8; }
.u-lab { font: 700 10.5px var(--sans); fill: var(--bt-ink); text-anchor: middle; paint-order: stroke; stroke: color-mix(in srgb, var(--bt-sea-a) 80%, transparent); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.u-lab { fill: color-mix(in srgb, var(--sc, var(--bt-ink)) 78%, var(--bt-ink)); }
:root[data-theme="dark"] .u-lab.jp { fill: #ff9c8d; } :root[data-theme="dark"] .u-lab.us { fill: #a9c6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .u-lab.jp { fill: #ff9c8d; } :root:not([data-theme="light"]) .u-lab.us { fill: #a9c6ff; } }
.u-lab.plane { font-weight: 500; font-size: 9.5px; opacity: 0; transition: opacity .4s; }
.u.act .u-lab.plane { opacity: 1; }
.u .sil { transform-box: fill-box; transform-origin: center; transition: transform 1.8s cubic-bezier(.5, 0, .5, 1), opacity 2.2s, filter 1s; }
.u.st-dmg .sil { filter: brightness(.85); }
.u.st-burn .sil { filter: brightness(.7) saturate(.8); }
.u.st-capsize .sil { transform: scaleX(.35); filter: brightness(.35) sepia(.4); }
.u.st-sunk .sil { opacity: .16; transform: scale(.88); filter: grayscale(1); }
.u.st-sunk .u-lab { text-decoration: line-through; opacity: .6; }
.u.st-capsize .u-lab { text-decoration: line-through; }
.u.st-down { animation: down 1.6s ease-in forwards; }
@keyframes down { 0% { opacity: 1; } 60% { opacity: .8; } 100% { opacity: 0; transform: translate(0, 22px); } }
.u .wake { opacity: 0; transition: opacity .6s; }
.u.moving .wake { opacity: .8; }
.wake path { fill: none; stroke: #f4fbfa; stroke-width: 1.2; stroke-linecap: round; }

/* 炎と煙 */
.fire { display: none; }
.u.st-burn .fire, .u.st-beach .fire { display: block; }
.u.st-dmg .smoke-only { display: block; }
.smoke-only { display: none; }
.u.st-sunk .fire, .u.st-sunk .smoke-only, .u.st-capsize .fire { display: none; }
.flame { fill: #ff8a1f; transform-box: fill-box; transform-origin: 50% 100%; animation: flick .35s ease-in-out infinite alternate; }
.flame.b { fill: #ffd34a; animation-duration: .27s; }
@keyframes flick { from { transform: scale(.8, .9); opacity: .85; } to { transform: scale(1.1, 1.25); opacity: 1; } }
.smoke { fill: #3b3733; opacity: 0; animation: smoke 2.6s ease-out infinite; }
.smoke-only .smoke { fill: #6a6560; }
@keyframes smoke { 0% { opacity: .75; transform: translate(0, 0) scale(.5); } 100% { opacity: 0; transform: translate(26px, -34px) scale(2.3); } }
.ripple { fill: none; stroke: #eef6f4; stroke-width: 1.2; opacity: 0; }
.u.st-sunk .ripple { animation: ripple 2.4s ease-out 1; }
@keyframes ripple { 0% { opacity: .9; r: 4; } 100% { opacity: 0; r: 34; } }

/* 効果 */
.fx-boom circle.o { fill: #ff9b2f; }
.fx-boom circle.i { fill: #fff3b8; }
.fx-boom { animation: boom .9s ease-out forwards; transform-box: fill-box; transform-origin: center; }
.fx-boom.big { animation-duration: 1.8s; }
@keyframes boom { 0% { transform: scale(.1); opacity: 1; } 55% { opacity: .95; } 100% { transform: scale(1.4); opacity: 0; } }
.fx-cloud { fill: #3d3935; animation: cloud 4s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes cloud { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(2.4) translate(6px, -14px); opacity: 0; } }
.fx-splash { fill: none; stroke: #f5fbfa; stroke-width: 2.5; animation: splash 1s ease-out forwards; }
@keyframes splash { 0% { r: 2; opacity: 1; } 100% { r: 20; opacity: 0; } }
.fx-flak { fill: #37332f; animation: flak 1.1s ease-out forwards; }
@keyframes flak { 0% { r: .5; opacity: .9; } 100% { r: 6; opacity: 0; } }
.fx-ping { fill: none; stroke-width: 2.5; animation: ping 1.6s ease-out forwards; }
.fx-ping.jp { stroke: #d63a2c; } .fx-ping.us { stroke: #2d63c4; } .fx-ping.n { stroke: #1d2a36; }
@keyframes ping { 0% { r: 4; opacity: 1; } 100% { r: 60; opacity: 0; } }
.fx-torp { fill: none; stroke: #f7fcfb; stroke-width: 2; stroke-dasharray: 3 4; opacity: .95; }
.fx-bubble { font: 700 12px var(--sans); }
.fx-bubble rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.fx-bubble text { fill: var(--ink); }
.fx-bubble { animation: bubble 3.4s ease forwards; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(6px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ev-pulse, .flame, .smoke, .bt-arrow { animation: none !important; }
}

/* ── スマホ・タブレット ── */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr 330px; }
  .bt-body { grid-template-columns: 1fr 300px; }
}
@media (max-width: 820px) {
  .app { height: auto; min-height: 100dvh; grid-template-rows: auto auto auto; }
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand-title { font-size: 18px; }
  .tools { margin-left: 0; width: 100%; }
  .theater { margin-left: auto; }
  .theater a { padding: 3px 9px; font-size: 12px; }
  .toggles { flex: 1; overflow-x: auto; }
  .tg span { padding: 3px 9px; font-size: 12.5px; white-space: nowrap; }
  .long { display: none; } .short { display: inline; }
  .layout { grid-template-columns: 1fr; }
  .map-wrap { height: 62vh; height: 62svh; min-height: 360px; }
  #map { touch-action: pan-y; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .panel-body, .detail { max-height: none; overflow: visible; padding: 14px 16px 24px; }
  .wm-year { font-size: 40px; } .wm-month { font-size: 21px; }
  .watermark { left: 12px; top: 8px; }
  .map-legend { display: none; }
  .map-ctrl button { width: 34px; height: 34px; }
  .timeline { position: sticky; bottom: 0; z-index: 10; padding: 6px 12px 4px; box-shadow: 0 -4px 14px rgba(0, 0, 0, .25); }
  .tl-top { gap: 8px; }
  .cnt { font-size: 19px; }
  .tl-sub .tl-showa, .tl-opts .tg, .tl-caption { display: none; }
  .tl-eralabs span { font-size: 0; }
  .tl-track { height: 50px; }
  .tl-btn { width: 28px; height: 30px; } .tl-btn.play { width: 38px; height: 34px; }
  .camp-player { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 8px 11px 10px; }
  .cp-lead, .cp-routes, .cp-kicker { display: none; }
  .camp-player h3 { font-size: 15px; }
  .cp-date { font-size: 15px; }
  .cp-text { font-size: 12px; min-height: 0; line-height: 1.5; }
  .cp-bar { margin: 5px 0; }
  .modal { padding: 0; }
  .modal-box, .battle-box { max-height: 100dvh; height: 100dvh; border-radius: 0; width: 100%; }
  .bt-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .bt-stage { aspect-ratio: 1000 / 620; }
  .bt-legend { display: none; }
  .bt-side { border-left: 0; border-top: 1px solid var(--line); }
  .bt-sides { display: none; }
  .modal-head { padding: 10px 14px; }
  .modal-head h2 { font-size: 17px; }
  .reg-list { columns: 1; }
}

/* ── 第一次世界大戦版：塹壕・鉄条網・森・毒ガス ── */
.bt-trench { fill: none; stroke: var(--sc); stroke-width: 3.2; stroke-dasharray: 7 2.5; stroke-linejoin: round; opacity: .85; }
.bt-wire { fill: none; stroke: #6f6a5f; stroke-width: 1.2; stroke-dasharray: 1.5 3; opacity: .8; }
.bt-wood { fill: #6f8a5c; opacity: .28; }
.bt-lake { stroke: var(--bt-land-line); stroke-width: .6; }
.fx-gas { fill: #c9d45a; opacity: 0; animation: gas 5.2s ease-out forwards; }
@keyframes gas { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 18% { opacity: .55; } 75% { opacity: .38; }
  100% { opacity: 0; transform: translate(var(--gx), var(--gy)) scale(1.6); } }
.fx-gas { transform-box: fill-box; transform-origin: center; }
.u.st-surr .sil { opacity: .45; filter: grayscale(1); }
.u.st-surr .u-lab { text-decoration: line-through; opacity: .7; }
.bt-rail { fill: none; stroke: #4d473d; stroke-width: 2.4; opacity: .7; }
.bt-rail-tie { fill: none; stroke: #4d473d; stroke-width: 7; stroke-dasharray: 1.2 7; opacity: .55; }

/* ══════════ ナポレオン戦争版：帝政様式（エンパイア・グリーンと金、蜜蜂と月桂樹） ══════════ */
.tl-g-a { stop-color: #2f4f9f; stop-opacity: .75; }
.tl-g-b { stop-color: #2f4f9f; stop-opacity: .08; }
:root.napoleon {
  --paper: #efe8d6; --paper-2: #e4dac2; --card: #f7f1e3; --ink: #221f19; --ink-2: #5b5444; --ink-3: #887f6a;
  --line: #cdbf9c; --line-2: #b09e74; --sea-a: #bccad0; --sea-b: #a6b8c0; --ctx: #dcd3bb; --ctx-line: #a89a78;
  --accent: #1f5a3f; --navy: #173a2b; --front: #b8322a;
  --bt-sea-a: #a9bcc4; --bt-sea-b: #90a8b2; --bt-land: #dccfa9; --bt-land-line: #867755;
}
@media (prefers-color-scheme: dark) {
  :root.napoleon:not([data-theme="light"]) {
    --paper: #141b17; --paper-2: #1a231e; --card: #1f2923; --ink: #ece3cb; --ink-2: #b8ad93; --ink-3: #847b66;
    --line: #33403a; --line-2: #48574f; --sea-a: #182430; --sea-b: #121c26; --ctx: #28302b; --ctx-line: #44504a;
    --accent: #d4b25a; --navy: #0e1612; --front: #ff7a5c;
    --bt-sea-a: #1d2c38; --bt-sea-b: #16222d; --bt-land: #38382e; --bt-land-line: #6a6652;
  }
}
:root.napoleon[data-theme="dark"] {
  --paper: #141b17; --paper-2: #1a231e; --card: #1f2923; --ink: #ece3cb; --ink-2: #b8ad93; --ink-3: #847b66;
  --line: #33403a; --line-2: #48574f; --sea-a: #182430; --sea-b: #121c26; --ctx: #28302b; --ctx-line: #44504a;
  --accent: #d4b25a; --navy: #0e1612; --front: #ff7a5c;
  --bt-sea-a: #1d2c38; --bt-sea-b: #16222d; --bt-land: #38382e; --bt-land-line: #6a6652;
}
.napoleon .topbar { border-bottom: 3px solid #c9a24a; background: linear-gradient(#1f4a36, #173a2b); }
.napoleon .brand-mark { position: relative; border-radius: 50%; border-color: #c9a24a; background: radial-gradient(circle, #1f4a36 0 52%, #c9a24a 54% 62%, #1f4a36 64%); }
.napoleon .brand-mark::after { content: 'N'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 13px var(--serif); color: #e9cf7e; }
.napoleon .theater a.portal-link { opacity: .9; }
.napoleon .theater a.portal-link::before { content: '◆ '; color: #c9a24a; }
/* 年表：緑の絹に金の縁取り、蜜蜂の刺繍（点） */
.napoleon .timeline { --tl-bg: #173a2b; --tl-ink: #f1e6c6; --tl-dim: #b9ad86; --tl-line: #3d6552; --tl-red: #e0b95a;
  background:
    radial-gradient(circle at 8px 8px, rgba(201, 162, 74, .28) 0 2px, transparent 2.5px) 0 0 / 34px 30px,
    linear-gradient(#1f4a36, var(--tl-bg));
  border-top: 0; position: relative; box-shadow: inset 0 3px 0 #c9a24a, inset 0 5px 0 #173a2b, inset 0 6px 0 #c9a24a; }
.napoleon .tl-btn { background: #1f4a36; border-color: #8a7338; color: #f1e6c6; border-radius: 3px; }
.napoleon .tl-btn.play { background: radial-gradient(circle, #e2c46a, #b38b36); color: #173a2b; border-color: #e9cf7e; border-radius: 50%; }
.napoleon .cnt-box { background: #0f2a1e; border-color: #8a7338; border-radius: 2px; font-family: var(--serif); color: #e9cf7e; }
.napoleon .tl-plot { background: linear-gradient(#123024, #0f271d); border-color: #8a7338; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(201, 162, 74, .25); }
.napoleon .tl-g-a { stop-color: #c9a24a; stop-opacity: .85; }
.napoleon .tl-g-b { stop-color: #c9a24a; stop-opacity: .12; }
.napoleon .tl-line { stroke: #e9cf7e; stroke-width: 1.4; }
.napoleon .tl-future { background: rgba(8, 20, 14, .55); }
.napoleon .tl-ruler { background: repeating-linear-gradient(90deg, #8a7338 0 1px, transparent 1px 8px); opacity: .6; }
.napoleon .tl-ev { background: #b9ad86; }
.napoleon .tl-ev.imp { background: #e9cf7e; box-shadow: 0 0 6px rgba(233, 207, 126, .8); }
.napoleon .tl-eralabs span.on { color: #e9cf7e; }
/* カーソル：金の「N」の徽章 */
.napoleon .tl-cursor { background: #e9cf7e; width: 2px; box-shadow: 0 0 6px rgba(233, 207, 126, .6); }
.napoleon .tl-cursor::before { border: 0; width: 18px; height: 18px; left: -8px; top: -10px; border-radius: 50%;
  background: radial-gradient(circle, #1f4a36 0 55%, #e2c46a 58% 100%); box-shadow: 0 0 0 1px #8a7338, 0 2px 6px rgba(0, 0, 0, .45); }
.napoleon .tl-cursor::after { content: 'N'; position: absolute; left: -8px; top: -10px; width: 18px; height: 18px; display: grid; place-items: center;
  font: 800 10px var(--serif); color: #e9cf7e; pointer-events: none; }
.napoleon .tl-cursor span { background: #c9a24a; color: #173a2b; border-radius: 2px; font-family: var(--serif); }
.napoleon .tl-hover { background: #f1e6c6; color: #173a2b; border-radius: 2px; font-family: var(--serif); }
.napoleon .tl-hover::after { border-top-color: #f1e6c6; }
.napoleon .tl-opts select { background: #1f4a36; color: #f1e6c6; border-color: #8a7338; }
.napoleon .map-legend { right: 34%; gap: 3px 4px; }
.napoleon .lg { font-size: 10.5px; padding: 0 6px 0 4px; gap: 4px; line-height: 1.55; }
.napoleon .lg i { width: 9px; height: 9px; }

/* ==== スマホの調整（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: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app > * { min-width: 0; }
  .timeline { position: sticky !important; bottom: 0; z-index: 30; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .map-wrap { height: calc(100svh - var(--top-h, 140px) - var(--dock-h, 140px)); min-height: 260px; }
  .topbar { gap: 6px 8px; }
  .brand-sub { display: none; }
  .brand-title { font-size: 16px; }
  .theater a { padding: 3px 8px; font-size: 11.5px; }
  .tl-top { flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
  .tl-sub, .tl-counter { display: none; }
  .tl-opts { gap: 6px; min-width: 0; }
  .tl-opts .sel { font-size: 0; }
  .tl-opts .sel select { font-size: 12px; margin-left: 0; }
  .toast { top: 10px; max-width: calc(100% - 90px); font-size: 12.5px; padding: 6px 14px; }
}
