/* 地図の青、森の緑、台帳の紙色。原作のドット絵に合わせる。 */
:root {
  color-scheme: light;
  --ink: #243c42; --muted: #58676b; --teal: #355f4b; --teal-dark: #254c39;
  --line: #cbd1c8; --sky: #e4eef1; --paper: #fffef9; --sand: #fff0c8;
  --hex: 32px; --radius: 4px; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f5f3e9; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; font-size: 14px; line-height: 1.75; }
a { color: #24566b; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--teal); border-radius: 3px; background: var(--teal); color: #fff; font-weight: 600; line-height: 1.5; cursor: pointer; }
button:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
.secondary { background: var(--paper); color: var(--ink); border-color: #a9b8af; }
.secondary:hover { color: #203e30; background: #e9efdf; border-color: #637e69; }
.quiet { color: var(--muted); background: transparent; border-color: transparent; }
.quiet:hover { color: var(--teal-dark); background: #e9eddf; border-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #bd8a22; outline-offset: 3px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid #adbcb5; border-radius: 3px; background: #fff; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #68777b; }
textarea { resize: vertical; }
label { display: block; margin: 12px 0; font-size: 12px; font-weight: 600; }
label input, label select, label textarea { margin-top: 5px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.4; margin-bottom: 12px; }
h2 { font-size: 19px; line-height: 1.5; margin-bottom: 12px; }
h3 { font-size: 14px; }
p { color: var(--muted); }
small { color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px; border: 2px solid var(--teal); background: var(--paper); }
.skip-link:focus { top: 8px; }

/* 共通の見出しと時間。見せる情報を一列に揃える。 */
.origin { display: flex; justify-content: space-between; gap: 12px; padding: 5px 28px; border-bottom: 1px solid #d9ded5; background: #e8ecdf; color: var(--muted); font-size: 11px; }
.origin a { white-space: nowrap; }
.header { max-width: 1400px; margin: auto; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #273e39; text-decoration: none; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #a7b6a7; background: #eeefd9; }
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.brand small { display: block; margin-top: 2px; font: 11px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif; letter-spacing: .03em; }
.brand-version { margin-left: 5px; font: 500 18px/1.5 ui-monospace, monospace; }
.head-actions { display: flex; align-items: center; gap: 8px; }
main { max-width: 1400px; margin: auto; padding: 0 32px 52px; }
.worldbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 18px; background: #e7eee3; border-top: 2px solid #627d63; border-bottom: 1px solid #c1ccbf; }
.world-title strong { margin-right: 12px; font-size: 21px; font-variant-numeric: tabular-nums; }
.world-title #population-count { font-size: 12px; color: var(--muted); }
.world-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 6px; height: 6px; background: #4a7050; border-radius: 50%; }
.clock { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 12px; }
.clock span, .clock small { color: var(--muted); font-size: 11px; }
.clock strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.clock small { grid-column: 1/-1; text-align: right; }
.connection-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0; font-size: 11px; color: var(--muted); }
.connection-bar button { padding: 6px 10px; font-size: 11px; }
.connection-bar.disconnected { padding: 8px 10px; background: #fff2d2; border: 1px solid #d7ba6c; color: #745112; }
.tabs { display: flex; gap: 0; margin: 0 0 24px; border-bottom: 1px solid #8d9f93; overflow: auto; }
.tabs button { flex-shrink: 0; padding: 12px 20px; background: transparent; color: var(--muted); border: 0; border-radius: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button:hover { background: #e9eddf; }
.tabs button.selected { border-bottom-color: #355f4b; background: #e8eddf; color: #254c39; }
.eyebrow { display: block; margin-bottom: 4px; font-size: 11px; color: var(--muted); font-weight: 500; }

/* 入口は見本の島と短い案内。地図は傾けず、32ドットのまま見せる。 */
.hero { display: grid; grid-template-columns: minmax(0,1fr) 440px; gap: 56px; align-items: center; padding: 34px 48px; margin-bottom: 30px; border: 1px solid #bfc9bf; border-top: 4px solid #627d63; background: var(--paper); }
.edition { display: inline-block; margin: 0 0 14px; color: #5b6f55; font-size: 12px; letter-spacing: .06em; }
.hero h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(30px, 3.1vw, 43px); font-weight: 600; line-height: 1.65; letter-spacing: .03em; margin-bottom: 22px; }
.hero-copy>p:not(.edition) { font-size: 14px; line-height: 2.1; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 24px; }
.hero-actions button { padding: 12px 20px; }
.text-link { font-size: 12px; font-weight: 500; }
button.text-link { padding: 6px 5px; border-color: transparent; background: transparent; color: #24566b; text-decoration: underline; text-underline-offset: 3px; }
button.text-link:hover { background: #e9eddf; color: #254c39; border-color: transparent; }
.hero-copy .hero-facts { margin: 22px 0 0; font-size: 12px; }
.hero-facts span { padding: 0 8px; color: #9baca0; }
.hero-island { margin: 0; width: 440px; padding: 10px 12px; border: 1px solid #b4c7cc; background: #e7eff2; }
.chart-heading { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 10px; color: #47636d; }
.hero-chart { position: relative; padding: 8px 0; border-top: 1px solid #b4c7cc; border-bottom: 1px solid #b4c7cc; }
#hero-map { width: 400px; margin: auto; }
.hero-row { display: flex; height: 32px; }
.hero-row:nth-child(odd) { padding-left: 16px; }
#hero-map img { display: block; flex-shrink: 0; width: 32px; height: 32px; image-rendering: pixelated; }
.hero-north { position: absolute; right: 2px; top: 12px; color: #d9e7ed; background: #204a64; font-size: 9px; padding: 1px 4px; }
.map-caption { margin-top: 8px; color: #47636d; font-size: 11px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 16px; }
.section-head h1, .section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; font-size: 13px; }
.search { display: flex; gap: 8px; }
.search input { width: 240px; }
.directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; border-top: 2px solid #899d89; }
.island-item { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; align-items: start; min-width: 0; padding: 17px 12px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); font-weight: 400; text-align: left; }
.island-item:hover { background: #ebeedd; border-color: var(--line); }
.island-thumb { display: grid; place-items: center; width: 44px; height: 44px; background: #e2e9cf; border: 1px solid #b7c5a7; }
.island-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.island-item h3 { margin: 3px 0 4px; font-size: 17px; overflow-wrap: anywhere; }
.island-item small { display: block; font-size: 12px; }
.rank { font-size: 11px; color: #496550; font-variant-numeric: tabular-nums; }
.island-item p { margin: 7px 0 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { grid-column: 1/-1; padding: 32px 20px; border-bottom: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 22px; }
.pager span { font-size: 12px; }

/* 島の見出しと資源は、六つの枠をひと続きの台帳にする。 */
.island-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 16px 0 18px; padding: 12px 0 18px; border-bottom: 2px solid #879b81; }
.island-title-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.island-emblem { flex-shrink: 0; display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid #a7b6a7; background: #e2e9cf; }
.island-emblem img { width: 32px; height: 32px; image-rendering: pixelated; }
.island-heading h1 { margin: 0 0 5px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.island-heading p { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.island-heading-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }
.island-heading-actions button { font-size: 12px; }
.island-stamp { color: var(--muted); font-size: 11px; }
.stats { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); margin-bottom: 16px; border: 1px solid #adbdb0; background: var(--paper); }
.stat { min-width: 0; padding: 12px 15px; border-right: 1px solid #ccd4c8; }
.stat:last-child { border-right: 0; }
.stat-header { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.stat-header img { width: 16px; height: 16px; image-rendering: pixelated; }
.stat-header span { font-size: 11px; color: var(--muted); }
.stat strong { display: block; font-size: 23px; font-weight: 600; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { display: block; margin-top: 2px; font-size: 11px; }
.stat .stat-delta { color: #355f4b; font-weight: 700; font-variant-numeric: tabular-nums; }
.turn-review { margin: 0 0 18px; padding: 14px 18px; background: #edf1e5; border: 1px solid #b9c5aa; border-left: 4px solid #537146; }
.review-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.review-heading>div { flex: 1 1 240px; min-width: 0; }
.review-heading p { margin: 3px 0 0; }
.turn-review .input-note { margin: 8px 0 0; }
.first-guide { margin: 14px 0; padding: 14px; background: #f4f2e6; border: 1px solid #c6bea1; }
.first-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; padding: 0; margin: 14px 0; list-style: none; counter-reset: step; font-size: 11px; }
.first-steps li { counter-increment: step; padding: 8px 4px; border-bottom: 2px solid #a9b1a7; color: #4c5f59; }
.first-steps li:before { content: counter(step) " "; font-weight: 700; }
.first-steps .current { color: #263e2b; background: #e6ecd9; border-bottom-color: #486a35; font-weight: 700; }
.first-steps .complete:before { content: "✓ "; }
@media(max-width:680px) { .first-steps { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.first-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.first-choices button { text-align: left; flex: 1 1 150px; }
.first-choices small { display: block; font-weight: 400; font-size: 11px; }
#turn-review, #first-guide, #map-changes { scroll-margin-top: 85px; }
.cell-change-row { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #d4dcce; font-size: 12px; }
.map-changes-list { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.change-images { display: flex; gap: 8px; }
.change-images img { width: 32px; height: 32px; image-rendering: pixelated; }
.tile-change { padding: 8px 10px; border-left: 3px solid #27627a; background: #edf3f5; font-size: 12px; }
.awards { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.award { display: flex; align-items: center; gap: 7px; padding: 5px 9px; background: #f8edd0; border: 1px solid #cdb778; font-size: 11px; }
.award img { width: 32px; height: 32px; image-rendering: pixelated; }
.island-nav { position: sticky; top: 8px; z-index: 10; display: flex; align-items: center; gap: 0; margin: 18px 0; padding: 3px; border: 1px solid #b6c1b3; background: #fffef9; overflow: auto; }
.island-nav button { padding: 8px 16px; background: transparent; color: var(--muted); border-color: transparent; border-radius: 0; white-space: nowrap; font-size: 12px; }
.island-nav button.selected, .island-nav button:hover, .dock-nav:hover { background: #e8eddf; color: #254c39; border-color: transparent; }
.island-nav button span { margin-left: 5px; padding: 1px 5px; background: #355f4b; color: #fff; font-size: 10px; }
.island-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(370px,1fr); align-items: start; gap: 20px; }
.card { min-width: 0; padding: 22px; border: 1px solid #bfc9be; border-radius: 4px; background: var(--paper); scroll-margin-top: 85px; }
.map-card { grid-column: 1; grid-row: 1; border-top: 3px solid #64818b; }
.planner-card { grid-column: 2; grid-row: 1/span 3; border-top: 3px solid #768760; }
.journal-card { grid-column: 1; grid-row: 2; }
.board-card { grid-column: 1; grid-row: 3; }
.profile-card { grid-column: 2; grid-row: 4; }
.visitor-card { grid-column: 2; grid-row: 1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #d0d7cd; }
.card-head h2 { margin: 0; }
.card-head button { flex-shrink: 0; font-size: 12px; }
.card>p { font-size: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.state-badge { padding: 4px 7px; border: 1px solid #b9c6b2; background: #ecf0e5; color: #45633d; white-space: nowrap; font-size: 11px; }
.state-badge.unsaved { color: #77551b; background: #fff0c8; border-color: #cda354; }

/* 地図の操作・描画。144マスの位置と行のずらしは原作のまま。 */
.map-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 10px; }
.map-switches { display: flex; align-items: center; gap: 14px; }
.map-switches label { display: flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; font-size: 12px; font-weight: 500; }
.map-switches input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--teal); }
.zoom { display: flex; align-items: center; gap: 5px; }
.zoom button { min-width: 44px; padding: 4px 10px; }
.zoom span { min-width: 34px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.map-scroll { max-width: 100%; padding: 18px 14px; overflow: auto; background: #e4edf0; border: 1px solid #b6c8ce; scrollbar-width: thin; overscroll-behavior: contain; }
.ocean-stage { position: relative; padding-top: 28px; padding-bottom: 24px; }
.sea-label { position: absolute; top: 6px; left: 14px; color: #4c6771; font-size: 10px; }
.compass { position: absolute; top: 6px; right: 14px; color: #4c6771; font-size: 10px; pointer-events: none; }
.game-map { width: calc(var(--hex)*12.5 + 14px); padding: 7px; margin: auto; }
.map-row { display: flex; height: var(--hex); }
.map-row:nth-child(odd) { margin-left: calc(var(--hex)*.5); }
.tile { position: relative; width: var(--hex); min-width: var(--hex); height: var(--hex); min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; line-height: 1; }
.tile:hover { background: transparent; filter: brightness(1.1); z-index: 2; }
.tile:active:not(:disabled) { transform: none; }
.tile img { display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.tile.selected:before, .tile:focus-visible:before { content: ""; position: absolute; inset: 0; border: 2px solid #ffe396; box-shadow: inset 0 0 0 1px #655011; z-index: 4; pointer-events: none; }
.tile:focus-visible { outline: 2px solid #fff; outline-offset: 1px; z-index: 5; }
.tile.selected { z-index: 3; }
.change-mark { position: absolute; left: 1px; bottom: 1px; color: #fff; background: #24556a; font-size: 9px; line-height: 12px; width: 12px; height: 12px; text-align: center; pointer-events: none; z-index: 3; }
.tile.guide-cell { outline: 2px dashed #fff5c9; outline-offset: -3px; z-index: 3; }
.tile.planned:after { content: attr(data-plan); position: absolute; top: 1px; right: 1px; min-width: 14px; padding: 1px 3px; background: #fff0b8; color: #513e13; border: 1px solid #ab9145; font-size: 10px; font-weight: 700; line-height: 1.25; z-index: 3; pointer-events: none; }
.tile.multi-plan:after { content: attr(data-plan) "+"; }
.coordinate-label { position: absolute; bottom: 0; left: 0; right: 0; background: #183c54cf; color: #fff; text-align: center; font-size: clamp(6px,calc(var(--hex)*.22),9px); line-height: 1.5; pointer-events: none; z-index: 2; }
.tile.batch-selected { box-shadow: inset 0 0 0 3px #c3f0e4; z-index: 3; }
.tile.batch-selected img { opacity: .78; }
.batch-number { position: absolute; top: 0; left: 0; z-index: 5; min-width: 15px; background: #264d42; color: #fff; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.4; pointer-events: none; }
.map-selection-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.map-selection-tools button { min-height: 44px; padding: 8px 10px; font-size: 11px; }
.map-selection-tools span { color: var(--muted); font-size: 11px; }
.map-selection-tools [aria-pressed="true"] { color: #254c39; background: #e4ecd7; border-color: #6e855f; }
.tile-inspector { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; align-items: center; margin: 14px 0; padding: 12px 0; border-top: 1px solid #c9d1c3; border-bottom: 1px solid #c9d1c3; }
.tile-inspector>img { width: 32px; height: 32px; image-rendering: pixelated; }
#tile-detail { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.tile-inspector button { font-size: 11px; }
.tile-inspector #tile-plans button { min-height: 44px; min-width: 44px; padding: 3px 5px; background: transparent; color: #24566b; border: 0; text-decoration: underline; font-size: 11px; }
.tile-inspector #tile-plans span { color: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.legend img { width: 16px; height: 16px; image-rendering: pixelated; }
.legend .legend-plan { margin-left: auto; font-size: 10px; }

/* 計画欄は入力を先に、案内と補助の道具はその後に。 */
.workflow { display: flex; justify-content: space-between; gap: 6px; margin: 6px 0 12px; padding: 8px 0; color: var(--muted); font-size: 11px; }
.workflow span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.workflow b { color: #607951; font: 600 12px/1.5 ui-monospace,monospace; }
.planner-note { font-size: 12px; }
.planner-heading-actions { display: flex; align-items: center; gap: 8px; }
#keyboard-help { min-height: 44px; padding: 6px 8px; font-size: 11px; font-weight: 500; }
.command-shortcuts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; margin: 14px 0; border: 1px solid #b9c4ad; }
.command-shortcuts button { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 8px 2px; background: #f2f3e5; color: #435f42; border: 0; border-right: 1px solid #c7cfba; border-radius: 0; font-size: 11px; }
.command-shortcuts button:last-child { border-right: 0; }
.command-shortcuts button:hover { background: #e6ebd2; }
.command-shortcuts button.selected { background: #e0e9cd; box-shadow: inset 0 -3px #6a8454; color: #284726; }
.command-shortcuts button img { width: 32px; height: 32px; image-rendering: pixelated; }
.command-shortcuts button>span { display: grid; place-items: center; width: 32px; height: 32px; background: #e5e8d7; color: #546048; font-family: "Hiragino Mincho ProN",serif; font-size: 16px; }
.form-row { display: flex; gap: 10px; }
.form-row>label, .form-row>button { flex: 1; min-width: 0; }
.help { min-height: 60px; padding: 10px 12px; background: #edf0e2; border-left: 3px solid #8d9f75; font-size: 12px; line-height: 1.8; }
.command-context { padding: 8px 10px; background: #f6f4e5; border: 1px solid #d2d5bf; color: #495e41; font-size: 11px; overflow-wrap: anywhere; }
.target-fields { padding: 3px 12px 12px; border: 1px solid #c4d2d4; background: #edf2f1; }
#target-preview { width: 100%; font-size: 12px; }
.input-note { padding: 8px 10px; border-left: 2px solid #aab897; background: #f3f3e7; font-size: 12px; overflow-wrap: anywhere; }
.inline-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0; font-size: 12px; }
.inline-choice input, .plan-pick input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--teal); }
#batch-cell-plan { width: 100%; margin-bottom: 12px; }
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; padding-top: 16px; border-top: 2px solid #a4b397; }
.queue-heading h3 { margin: 0; }
.queue-heading span { font-size: 11px; color: var(--muted); }
.plan-tools { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 12px; }
.plan-tools button { padding: 6px 8px; font-size: 11px; }
.plan-selection-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 10px; margin: 12px 0; border: 1px solid #c9d0c0; background: #f1f2e5; font-size: 11px; }
.plan-selection-tools .inline-choice { margin: 0; }
.plan-selection-tools>div { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.plan-selection-tools button { padding: 7px 9px; font-size: 11px; }
.plan-list { padding: 0; margin: 0; list-style: none; max-height: 560px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.plan-list li { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 8px; align-items: center; padding: 10px 4px; border-top: 1px solid #d4d9cc; border-left: 3px solid transparent; font-size: 12px; line-height: 1.5; }
.plan-list li:first-child { background: #fbefcc; border-top-color: #cbbb88; }
.plan-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: start; gap: 4px; min-height: 44px; margin: 0; cursor: pointer; }
.plan-number { color: #486747; font: 600 12px/1.5 ui-monospace,monospace; }
.plan-text { overflow-wrap: anywhere; }
.plan-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; grid-column: 2; gap: 4px; }
.plan-actions button { min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 11px; }
.plan-actions [draggable="true"] { cursor: grab; }
.plan-actions [draggable="true"]:active { cursor: grabbing; }
.plan-list li.changed { border-left-color: #c59b3c; }
.plan-list li.editing { background: #e8edda; border-left-color: #637d51; }
.plan-list li.picked { background: #e4eef0; }
.plan-list li.drop-target { outline: 2px solid #386759; outline-offset: -2px; background: #e0ebdd; }
.plan-change { margin-left: 6px; padding: 2px 4px; background: #fff0c4; color: #715116; font-size: 10px; white-space: nowrap; }
.save-panel { padding: 14px; margin-top: 20px; border: 1px solid #a7b894; background: #edf0dd; scroll-margin-top: 85px; }
.save-panel p { margin-bottom: 10px; font-size: 12px; line-height: 1.8; }
.save-panel>button { width: 100%; margin: 4px 0; }
.warning { padding: 10px 12px; background: #fff1cb; color: #78551c; border: 1px solid #d5b675; font-size: 12px; overflow-wrap: anywhere; }
#notice { margin: 12px 0; padding: 10px 14px; background: #e6eeda; border: 1px solid #a5b892; color: #34562c; white-space: pre-wrap; font-size: 12px; }
#notice.error { background: #fbece3; border-color: #dcb29c; color: #894b2e; }
.finish-panel { padding: 0 0 5px; margin: 10px 0; border-top: 1px solid #ccd2c3; overflow-wrap: anywhere; }
.finish-panel>summary { display: flex; align-items: center; min-height: 44px; color: #465c3e; font-size: 12px; font-weight: 600; cursor: pointer; }
.finish-panel>summary::before { content: '＋'; margin-right: 8px; color: #74865f; }
.finish-panel[open]>summary::before { content: '−'; }
.finish-panel>p, .finish-panel li { font-size: 12px; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.finish-actions>* { max-width: 100%; min-height: 44px; }
.finish-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.finish-check input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; margin: 0; }
.library-entry { padding: 12px 0; border-top: 1px solid #d3d7ca; overflow-wrap: anywhere; }
.library-entry>strong, .library-entry>small { display: block; }
.library-entry>small { color: var(--muted); margin: 4px 0; }
.plan-advice { padding: 10px 0; border-top: 1px solid #d3d7ca; }
.plan-advice>span { display: block; }
.plan-advice.critical { color: #8a4427; }
.file-button { position: relative; display: inline-flex; align-items: center; padding: 9px 12px; border: 1px solid #a9b8af; border-radius: 3px; background: var(--paper); cursor: pointer; overflow: hidden; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 3px solid #bd8a22; outline-offset: 3px; }
#other-draft button { max-width: 100%; margin: 4px; }

/* 記録と伝言。色の面を増やさず、区切り線と本文で読む。 */
.journal-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.journal-tools select { max-width: 230px; font-size: 12px; }
.logs { overflow-wrap: anywhere; }
.turn-group { margin: 16px 0 5px; padding-left: 14px; border-left: 2px solid #c7d1bb; }
.turn-heading { display: block; margin-bottom: 3px; color: #496443; font-size: 11px; font-weight: 600; }
.log-entry { padding: 10px 0; border-bottom: 1px solid #e0e3d7; font-size: 12px; line-height: 1.9; }
.log-entry small { color: #496443; font-size: 10px; }
.logs .island { color: var(--ink); font-weight: 600; }
.logs .command { color: #24576c; font-weight: 600; }
.logs .disaster { color: #995135; }
.logs .prize { color: #7c5b14; }
.event-badge { display: inline-block; margin-right: 6px; padding: 1px 5px; border: 1px solid #cdb799; color: #7a5025; background: #fcf1dd; font-size: 10px; }
.event-badge.prize { background: #f9efc7; border-color: #ccb774; }
.secret-tag { display: inline-block; margin-right: 7px; padding: 1px 5px; color: #56654d; background: #e9eddf; border: 1px solid #c3ccb6; font-size: 10px; }
.logs>div { padding: 10px 0; border-bottom: 1px solid #e0e3d7; font-size: 12px; }
.logs>div>small { display: block; color: #496443; }
.post { padding: 16px 0; border-bottom: 1px solid #d5d9cd; overflow-wrap: anywhere; font-size: 13px; }
.post-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.post-header>div { min-width: 0; }
.post-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; }
.post-avatar img { width: 32px; height: 32px; image-rendering: pixelated; }
.post strong { font-size: 12px; }
.post small { font-size: 10px; }
.post time { font-size: 11px; color: var(--muted); }
.post p { margin: 8px 0 0; white-space: pre-wrap; }
.post-message, .reply-quote, .post-identity, .post-destination, #reply-summary, #post-pending { overflow-wrap: anywhere; word-break: break-word; }
.community-actions, .post-links, .favorite-islands { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.community-actions button, .post-links button, #board-card button, #view-community button { min-height: 44px; }
.post-choice { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; }
.post-choice input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--teal); }
.post-links .post-choice { margin-left: auto; }
.post-identity { font-size: 11px; margin-top: 8px; }
.post-identity .text-link { padding: 0 5px; }
.reply-quote { margin: 12px 0 8px; padding: 8px 12px; border-left: 3px solid #8f9e7a; background: #f0f1e4; color: var(--muted); font-size: 12px; }
.reply-context { padding: 10px 12px; margin-bottom: 12px; border: 1px solid #bdc8ad; background: #eef0dd; }
.reply-context p { margin: 0 0 4px; font-size: 12px; }
.post-destination { color: #45633d; font-weight: 600; }
.post-point { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.post-point input { width: 18px; height: 18px; min-height: 18px; margin: 0; }
.unread-post { border-left: 3px solid #63845c; padding-left: 14px; }
.notice-kind { margin-left: auto; padding: 2px 6px; border: 1px solid #bdc8ad; color: #45633d; background: #ecf0df; font-size: 10px; }
#post-form { margin-top: 18px; padding-top: 4px; border-top: 1px solid #d5d9cd; }
#post-form textarea { min-height: 110px; }
#post-form small { display: block; font-size: 11px; margin-top: 12px; }
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#hide-posts { margin-top: 12px; font-size: 11px; }
.profile-card small { font-size: 11px; }
#community-badge { padding: 1px 6px; margin-left: 4px; background: #825628; color: #fff; font-size: 11px; }
#view-community>.card, #community-content>.card { margin: 18px 0; }
#community-content { min-width: 0; }
#community-content .card-head>label { display: flex; align-items: center; gap: 7px; min-height: 44px; font-size: 12px; }
#community-unread { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; }
.favorite-island { display: flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; border-bottom: 1px solid #c7d1bb; background: #f1f2e5; overflow-wrap: anywhere; }
#muted-islands:empty { display: none; }
#board-search { margin: 12px 0; }
#board-search input { width: 100%; min-width: 0; }
#board-search button { flex-shrink: 0; }
#board-status, #board-link { font-size: 12px; }
#board-link { width: 100%; }
#board-link-label { margin: 10px 0; }

/* 遊び方・各種の確認画面。 */
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.guide-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 24px; margin-bottom: 24px; }
.guide-grid .card { padding: 18px 0; background: transparent; border: 0; border-top: 1px solid #b4c2aa; border-radius: 0; }
.guide-grid h2 { font-size: 17px; }
.guide-grid p { margin-bottom: 0; font-size: 13px; }
.guide-number { display: block; margin-bottom: 8px; color: #526944; font: 500 20px/1.5 ui-monospace,monospace; }
.reference-row { display: grid; grid-template-columns: 170px 90px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.reference-row small { font-size: 12px; }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 26px; padding: 22px 28px; border-top: 1px solid #c5cec0; background: #e9eddf; color: var(--muted); font-size: 12px; }
dialog { width: 440px; max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 24px; overflow: auto; border: 1px solid #8da085; border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 50px #203b3f33; }
dialog::backdrop { background: #263c4280; }
dialog p { font-size: 13px; }
dialog .card-head button { min-width: 44px; min-height: 44px; padding: 4px 12px; }
dialog form>button { width: 100%; margin-top: 10px; }
.credits { max-width: 820px; margin: auto; padding: 32px 24px; }
.credits li { margin: 10px 0; }
#target-dialog { width: 610px; }
#map-dialog { width: 1000px; }
#map-dialog .map-scroll { max-height: 65dvh; }
#expanded-detail { padding: 10px 12px; margin: 14px 0; background: #eef0e1; color: var(--ink); font-weight: 600; }
#compare-dialog { width: 820px; }
.compare-scroll { max-height: 48dvh; overflow: auto; border: 1px solid var(--line); }
.plan-compare { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.plan-compare th, .plan-compare td { padding: 12px 10px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.plan-compare thead th { position: sticky; top: 0; z-index: 1; background: #e9eddf; }
.plan-compare th:first-child { width: 65px; }
.plan-compare th:nth-child(4), .plan-compare td:nth-child(4) { width: 90px; }
.plan-compare tbody th small { display: block; font-size: 10px; }
.plan-compare .different { background: #fff1cf; }
.plan-compare .different th small { color: #77551b; }
.plan-compare .finish-check { margin: 0; font-size: 12px; }
.compare-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.compare-actions button { flex: 1; min-width: 180px; }
#compare-dialog .muted { margin-top: 16px; }
.change-preview { max-height: 32dvh; padding: 0; list-style: none; overflow: auto; border: 1px solid var(--line); }
.change-preview li { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.change-preview li:last-child { border: 0; }
#dropped-plans ul { margin: 8px 0 0; padding-left: 18px; }
#plan-action-dialog { width: 620px; }
#plan-action-form>.form-row { margin-top: 16px; }
.shortcut-guide { font-size: 12px; }
.shortcut-guide dt { color: #45633d; font-weight: 600; margin-top: 16px; }
.shortcut-guide dd { margin: 5px 0 0; }
.operation-toast { position: fixed; left: 50%; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 12px; transform: translateX(-50%); width: max-content; max-width: min(640px,calc(100vw - 24px)); padding: 10px 10px 10px 14px; border: 1px solid #a1b293; border-radius: 3px; background: #f0f3e4; color: var(--ink); box-shadow: 0 5px 20px #203b3f22; font-size: 12px; line-height: 1.6; pointer-events: none; }
.operation-toast.error { border-color: #c49e80; background: #fff0df; }
.operation-toast button { flex-shrink: 0; min-width: 44px; min-height: 44px; padding: 5px; pointer-events: auto; }
#operation-message { max-height: 20dvh; overflow: auto; overflow-wrap: anywhere; }
.island-dock { display: none; }

/* 幅に応じた組み替え。文字と操作を小さくして詰め込まない。 */
@media(min-width:981px) { .island-layout.owned .board-card { grid-row: 3/span 2; } }
@media(max-width:1180px) {
  .hero { gap: 24px; padding: 28px 30px; }
  .world-note { display: none; }
  .stat { padding: 11px 10px; }
  .stat strong { font-size: 20px; }
  .island-layout { grid-template-columns: minmax(0,1.2fr) minmax(340px,1fr); }
  .tile-inspector { grid-template-columns: 32px minmax(0,1fr); }
  .tile-inspector>button { grid-column: 2; justify-self: start; }
}
@media(max-width:980px) {
  .header { padding: 18px 24px; }
  main { padding: 0 24px 44px; }
  .hero { grid-template-columns: minmax(0,1fr) 344px; padding: 26px 28px; gap: 20px; }
  .hero-island { width: 344px; padding: 8px; }
  #hero-map { width: 300px; }
  .hero-row { height: 24px; }
  .hero-row:nth-child(odd) { padding-left: 12px; }
  #hero-map img { width: 24px; height: 24px; }
  .hero h1 { font-size: 31px; }
  .hero-copy>p:not(.edition) { font-size: 13px; }
  .island-layout { grid-template-columns: 1fr; gap: 18px; }
  .island-layout>.card { grid-column: 1; grid-row: auto; }
  .map-card { order: 1; } .planner-card { order: 2; } .journal-card { order: 3; } .board-card { order: 4; } .profile-card, .visitor-card { order: 5; }
  .stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat:nth-child(-n+3) { border-bottom: 1px solid #ccd4c8; }
  .stat:nth-child(3n) { border-right: 0; }
  .guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tile-inspector { grid-template-columns: 32px minmax(0,1fr) auto; }
  .tile-inspector>button { grid-column: auto; }
  .island-dock { position: fixed; bottom: 10px; left: 24px; right: 24px; z-index: 20; display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid #9daf91; background: #fffef5; box-shadow: 0 3px 16px #203b3f22; }
  .dock-nav { padding: 8px 12px; min-width: 54px; border-color: transparent; background: #fffef5; color: var(--ink); font-size: 12px; }
  .dock-status { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .dock-status small { max-width: 100px; font-size: 10px; line-height: 1.4; }
  .dock-status button { min-width: 68px; padding: 8px 14px; font-size: 12px; }
  .island-open footer { padding-bottom: 100px; }
  .island-open .operation-toast { bottom: 86px; }
  .card, .save-panel { scroll-margin-top: 82px; }
}
@media(max-width:680px) {
  .origin { padding: 5px 14px; font-size: 10px; } .origin span { display: none; }
  .header { padding: 16px 14px; gap: 10px; align-items: flex-start; }
  .brand { font-size: 21px; gap: 8px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand small { font-size: 10px; } .brand-version { font-size: 14px; }
  .head-actions { gap: 2px; flex-direction: column; align-items: flex-end; }
  .head-actions button { padding: 7px 9px; font-size: 11px; }
  main { padding: 0 12px 36px; }
  .worldbar { padding: 10px 12px; gap: 8px; }
  .world-title strong { display: block; font-size: 19px; margin: 0; }
  .world-title #population-count { font-size: 10px; }
  .clock { display: block; text-align: right; }
  .clock span, .clock small { display: block; font-size: 10px; }
  .clock strong { font-size: 22px; }
  .connection-bar { font-size: 10px; }
  .tabs { margin-bottom: 18px; }
  .tabs button { padding: 10px 12px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 26px 20px; }
  .hero h1 { margin-bottom: 18px; font-size: 30px; line-height: 1.55; }
  .edition { margin-bottom: 10px; }
  .hero-actions { gap: 16px; margin-top: 20px; }
  .hero-actions button { padding: 11px 16px; font-size: 13px; }
  .hero-island { width: 100%; max-width: 344px; justify-self: center; }
  #hero-map { width: 250px; }
  .hero-row { height: 20px; }
  .hero-row:nth-child(odd) { padding-left: 10px; }
  #hero-map img { width: 20px; height: 20px; }
  .map-caption { font-size: 10px; }
  .section-head { flex-wrap: wrap; margin: 20px 0 14px; }
  .search { width: 100%; } .search input { flex: 1; width: auto; min-width: 0; }
  .directory { grid-template-columns: 1fr; }
  .island-item { padding: 15px 6px; }
  .island-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding-bottom: 14px; margin-top: 10px; }
  .island-title-block { flex: 1; gap: 12px; }
  .island-emblem { width: 44px; height: 44px; }
  .island-heading h1 { margin-bottom: 4px; font-size: 25px; }
  .island-heading p { font-size: 11px; }
  .island-heading-actions { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; padding-top: 10px; border-top: 1px solid #cbd1c8; }
  .island-heading-actions button, .island-stamp { font-size: 10px; }
  .stat { padding: 10px 8px; } .stat-header { gap: 4px; margin-bottom: 6px; }
  .stat-header span { font-size: 10px; } .stat strong { font-size: 18px; } .stat small { font-size: 10px; }
  .island-nav { top: 6px; gap: 0; padding: 3px; margin: 14px 0; }
  .island-nav button { flex: 1; min-width: 0; padding: 8px 10px; font-size: 11px; }
  .island-nav button span { margin-left: 3px; padding: 1px 4px; font-size: 9px; }
  .card { padding: 16px; } .card-head { gap: 8px; margin-bottom: 12px; }
  .card-head h2 { font-size: 18px; } .card-head button { padding: 8px 10px; font-size: 11px; }
  .map-toolbar { gap: 4px; }
  .map-scroll { padding-left: 6px; padding-right: 6px; }
  .ocean-stage { padding-top: 26px; padding-bottom: 18px; }
  .sea-label { left: 10px; } .compass { right: 10px; }
  .tile-inspector { grid-template-columns: 32px minmax(0,1fr); gap: 10px; }
  .tile-inspector>button { grid-column: 2; font-size: 11px; }
  .legend { gap: 6px 10px; } .legend span { font-size: 10px; } .legend .legend-plan { width: 100%; margin-left: 0; }
  .workflow { font-size: 10px; gap: 4px; } .workflow b { font-size: 11px; }
  .plan-tools button { padding: 6px 7px; font-size: 10px; }
  .plan-actions button { padding: 0 7px; }
  .form-row { gap: 8px; } .form-row button { padding: 10px 8px; font-size: 12px; }
  .map-selection-tools { gap: 5px; } .map-selection-tools #selection-to-plan { flex-grow: 1; }
  .journal-tools { gap: 8px; } .journal-tools select { max-width: 205px; font-size: 11px; } .journal-tools span { font-size: 10px; }
  .island-dock { left: 10px; right: 10px; bottom: 8px; gap: 0; padding: 5px; }
  .dock-nav { min-width: 45px; padding: 8px 10px; font-size: 11px; } .dock-status { gap: 7px; }
  .dock-status small { max-width: 62px; font-size: 9px; } .dock-status button { min-width: 60px; padding: 8px 11px; }
  .guide-grid, .two-columns { grid-template-columns: 1fr; }
  .reference-row { grid-template-columns: 1fr 70px; gap: 6px; } .reference-row small { grid-column: 1/-1; }
  footer { padding: 20px 14px; gap: 10px 20px; }
  .pager { gap: 12px; } dialog, #compare-dialog { padding: 18px; }
  .plan-compare th:first-child { width: 43px; } .plan-compare th, .plan-compare td { padding: 10px 6px; }
  .plan-compare th:nth-child(4), .plan-compare td:nth-child(4) { width: 64px; padding: 6px 3px; }
  .plan-compare .finish-check { flex-direction: column; gap: 4px; }
  .compare-actions button { min-width: 100%; min-height: 44px; font-size: 13px; }
  #map-dialog .form-row { flex-wrap: wrap; } #map-dialog .form-row button { flex-basis: 40%; } #map-dialog .form-row #expanded-to-plan { flex-basis: 100%; }
  .finish-actions>* { flex: 1 1 140px; }
  .post-links .post-choice { margin-left: 0; width: 100%; }
  .favorite-island { width: 100%; justify-content: space-between; } .favorite-island>button:first-child { text-align: left; }
  .post-header .notice-kind { margin-left: 0; } .post-point { flex-wrap: wrap; }
  #community-content .card-head, #board-card .card-head { flex-wrap: wrap; }
  .operation-toast { font-size: 11px; }
}
@media(max-width:360px) {
  .brand-version { display: none; } .brand { font-size: 20px; }
  .hero { padding: 24px 16px; } #hero-map { width: 225px; } .hero-row { height: 18px; }
  .hero-row:nth-child(odd) { padding-left: 9px; } #hero-map img { width: 18px; height: 18px; }
  .hero h1 { font-size: 28px; } .hero-copy .hero-facts { font-size: 11px; }
  .island-nav button { padding: 8px 8px; font-size: 10px; }
  .stat strong { font-size: 17px; } .stat-header span { font-size: 9px; }
  .dock-status small { max-width: 47px; } .dock-nav { padding: 8px 9px; }
}
@media(prefers-reduced-motion:no-preference) {
  button, a { transition: background-color .12s, border-color .12s; }
}
@media(forced-colors:active) {
  .tile.selected:before, .tile:focus-visible:before { border-color: Highlight; }
  .tile.planned:after, .batch-number { forced-color-adjust: none; }
}
