/* Design 05 · Expedition — a campaign journal in warm paper, with a deep green stage accent. */
:root {
  --bg: #f6f1e6;
  --panel: #fffdf7;
  --panel-2: #f3ecdc;
  --line: #e0d6c1;
  --line-strong: #c9bda2;
  --text: #241d15;
  --muted: #7b7161;
  --stage: #2f5d50;
  --stage-soft: rgba(47, 93, 80, 0.12);
  --stage-text: #f4f8f5;
  --primary: #241d15;
  --accent: #d5006c;
  --accent-soft: rgba(213, 0, 108, 0.1);
  --radius: 8px;
  --shadow: 0 10px 30px rgba(50, 35, 15, 0.16);
  --rail-w: 220px;
  --choices-w: 340px;
}
body { background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display-font); font-weight: 600; letter-spacing: -0.01em; }
.eyebrow { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--stage); }
.row.nowrap { flex-wrap: nowrap; }
.btn { border-radius: 6px; }
.btn.go { background: var(--stage); color: var(--stage-text); border-color: var(--stage); font-weight: 600; }
.btn.go:hover:not(:disabled) { background: #26483f; border-color: #26483f; }
.btn.go.big { width: 100%; justify-content: center; padding: 9px 12px; font-size: 14px; margin-top: 6px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.btn.help { font-family: var(--display-font); font-weight: 700; width: 30px; justify-content: center; }
button.link { color: var(--stage); }
.chip { text-transform: none; font-weight: 500; }
.chip.size-metropolis, .chip.size-city { background: #e8dcc2; color: #5a4310; }
.chip.size-town { background: #e2e8dd; color: #2f5d50; }
.chip.kind-lair { background: #f3d9d5; color: #7a1410; }
.chip.kind-ruin, .chip.kind-cave, .chip.kind-mine { background: #ebe1cf; color: #5c4a2a; }
.chip.kind-inn, .chip.kind-tavern { background: #f6e3c8; color: #7a4f16; }
.chip.kind-temple, .chip.kind-shrine { background: #ebdff0; color: #5c3a6e; }
.chip.kind-keep, .chip.kind-manor { background: #e3e1dc; color: #3d3a35; }

/* ---- thumbnails ---- */
.thumb { position: relative; border-radius: 6px; overflow: hidden; background: #efe5cf; border: 1px solid var(--line); flex: none; }
.thumb .mapsvg { cursor: default; --paper: #f2e8d3; }
.thumb .mapsvg .lbl, .thumb .mapsvg .layer-labels { display: none; }
.thumb .mapsvg .glyphs-tree { display: none; }
.thumb .mapsvg .coast-glow, .thumb .mapsvg .sym, .thumb .mapsvg .road-casing, .thumb .mapsvg .road-trail { display: none; }
.thumb .mapsvg .road-major { stroke-width: 1px; } .thumb .mapsvg .road-minor { stroke-width: 0.6px; }
.thumb .mapsvg .river { stroke-width: 0.9px !important; } .thumb .mapsvg .kingdom-border { stroke-width: 1px; stroke-dasharray: none; }
.thumb .mapsvg .region-land, .thumb .mapsvg .land-fill { stroke-width: 0.8px; }
.thumb:empty::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, #efe5cf 0 6px, #e8ddc4 6px 12px); opacity: 0.7; }

/* ================= World list ================= */
.list-screen { height: 100vh; overflow: auto; }
.journal { max-width: 1180px; margin: 0 auto; padding: 44px 32px 64px; }
.journal-head h1 { font-size: 44px; margin: 6px 0 10px; }
.lede { font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 720px; margin: 0; }
.create-card { margin: 28px 0 30px; padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 0 rgba(0,0,0,0.03); }
.create-card h3 { font-size: 20px; }
.create-grid { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr 1fr; gap: 12px; }
.create-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.create-grid input { width: 100%; }
.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.world-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.world-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cover-wrap { position: relative; cursor: pointer; border-bottom: 1px solid var(--line); }
.cover-wrap .thumb.cover { width: 100% !important; height: 160px !important; border: none; border-radius: 0; }
.cover-seed { position: absolute; right: 10px; bottom: 8px; font: 11px ui-monospace, monospace; background: rgba(255, 253, 247, 0.85); padding: 2px 6px; border-radius: 4px; color: var(--muted); }
.world-body { padding: 14px 16px 16px; }
.world-body h3 { font-size: 22px; }
.world-body p { margin: 4px 0 12px; }
.world-body .actions { gap: 6px; }

/* ================= World shell ================= */
.world-screen { display: grid; grid-template-columns: var(--rail-w) 1fr var(--choices-w); height: 100vh; overflow: hidden; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.rail-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 6px 8px; }
.wordmark { font-family: var(--display-font); font-style: italic; color: var(--muted); font-size: 13px; padding-right: 6px; }
.stages { list-style: none; margin: 0; padding: 4px 10px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; position: relative; }
.stage { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 10px 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.stage:hover { border-color: var(--line-strong); }
.stage.current { border-color: var(--stage); box-shadow: inset 3px 0 0 var(--stage); }
.stage.idle { cursor: default; opacity: 0.62; background: transparent; border-style: dashed; }
.stage.idle:hover { border-color: var(--line); }
.stage-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--ui-font); color: var(--muted); border: 1.5px solid var(--line-strong); background: var(--panel); }
.stage.current .stage-num, .stage.cached .stage-num { background: var(--stage); border-color: var(--stage); color: var(--stage-text); }
.stage.cached .stage-num { background: #7c9d93; border-color: #7c9d93; }
.stage-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stage-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.stage-name { font-family: var(--display-font); font-weight: 600; font-size: 14px; }
.pill { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.pill.current { background: var(--stage); color: var(--stage-text); }
.pill.cached { background: var(--stage-soft); color: var(--stage); }
.pill.idle { background: var(--panel-2); color: var(--muted); }
.stage-choice { font-size: 12.5px; line-height: 1.3; }
.stage-meta { font-size: 11px; display: flex; align-items: center; gap: 2px; }
.stage-hint { font-size: 11.5px; line-height: 1.35; font-style: italic; }
.rail-thumb { width: 100% !important; height: 96px !important; margin-top: 5px; }
.rail-foot { padding: 8px 14px 10px; border-top: 1px solid var(--line); }
.rail-foot .busy { color: var(--stage); font-weight: 600; }

/* ---- main column ---- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ctx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 20px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ctx-text { min-width: 0; }
.crumb-line .breadcrumb { font-size: 11px; }
.crumb-line .crumb { padding: 1px 4px; }
.ctx-head h1 { font-size: 30px; line-height: 1.1; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.ctx-tools { display: flex; align-items: center; gap: 8px; flex: none; padding-bottom: 4px; }
.map-wrap { position: relative; flex: 1; min-height: 0; background: #f2e8d3; }
.map-wrap .map { position: absolute; inset: 0; }
.map-status { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: var(--muted); background: rgba(255, 253, 247, 0.85); padding: 2px 7px; border-radius: 4px; pointer-events: none; }
.pick-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; background: var(--stage); color: var(--stage-text); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); pointer-events: none; }
.mapsvg.picking { cursor: crosshair; }
.mapsvg .preview-mask { fill-opacity: 0.22; }
.mapsvg[data-scale="region"].quiet-pois .lbl-point { display: none; }
/* Selection flash: the halo swells for 600 ms when a row is chosen. */
.mapsvg .hl-sel.flash .hl-ring { animation: exp-flash-ring .6s ease-out; transform-origin: 0 0; }
.mapsvg .hl-sel.flash .hl-glow.area, .mapsvg .hl-sel.flash .hl-glow.line { animation: exp-flash-glow .6s ease-out; }
@keyframes exp-flash-ring { 0% { transform: scale(2.6); stroke-width: 5; opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
@keyframes exp-flash-glow { 0% { stroke-width: 34px; stroke-opacity: 0.6; } 100% { stroke-width: 10px; stroke-opacity: 0.35; } }

/* ---- Choices column ---- */
.choices { position: relative; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; overflow: hidden; }
.choices-body { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; }
.choices-body.covered { overflow: hidden; visibility: hidden; }
.choices-head { padding: 14px 16px 8px; }
.choices-head h2 { font-size: 24px; margin-top: 2px; }
.choices-content { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.lead { margin: 0 4px 2px; line-height: 1.4; }
.card { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: border-color .12s, background .12s; }
.card.cand { cursor: pointer; flex-wrap: wrap; }
.card.cand:hover { border-color: var(--line-strong); background: #fffef9; }
.card.cand.selected { border-color: var(--stage); box-shadow: 0 0 0 1px var(--stage); background: #fbfaf3; }
.card.custom { border-style: dashed; }
.card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-title { font-family: var(--display-font); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-facts { font-size: 11.5px; line-height: 1.35; }
.card .thumb { width: 96px; height: 96px; }
.cand-edit { flex-basis: 100%; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.cand-edit input[type="range"] { width: 100%; accent-color: var(--stage); }
.cand-edit p { margin: 0; }
.card.anywhere { align-items: center; border-style: dashed; color: var(--muted); }
.card.anywhere .icon { color: var(--stage); }
.card.current-region { background: var(--stage-soft); border-color: transparent; }
.card.battle-spot { flex-direction: column; gap: 8px; background: var(--panel-2); border-color: transparent; }
.card.battle-spot .card-title .icon { color: var(--stage); }
.card.battle-spot.picking { outline: 2px dashed var(--stage); outline-offset: -2px; }
.card.battle-spot.placed { background: #fbfaf3; border-color: var(--stage); }
.picking-msg { display: inline-flex; align-items: center; gap: 5px; color: var(--stage); font-weight: 600; }
.steppers { gap: 10px; }
.stepper { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.stepper input { width: 58px; }
.card.selected-scene { align-items: center; background: var(--accent-soft); border-color: transparent; }
.filter-row { padding: 0 4px; color: var(--muted); }
.filter-row select { flex: 1; }
.floor-bar { padding: 2px 4px; }
.floor-bar select { flex: 1; }

/* sections and rows */
.section { border-top: 1px solid var(--line); }
.section summary { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 4px; cursor: pointer; list-style: none; font-family: var(--display-font); font-weight: 600; font-size: 14.5px; }
.section summary::-webkit-details-marker { display: none; }
.section summary .count { font: 500 11px var(--ui-font); color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 1px 7px; }
.section.active-floor summary { color: var(--stage); }
.rows { list-style: none; margin: 0; padding: 0 0 4px; }
.row-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; border-radius: 6px; cursor: pointer; border-left: 3px solid transparent; }
.row-item:hover, .row-item.hovered { background: var(--panel-2); }
.row-item.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.row-title .icon { color: var(--muted); flex: none; }
.row-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; margin-top: 1px; padding-left: 19px; }
.row-item .btn.go.small { opacity: 0; transition: opacity .12s; padding: 3px 9px; }
.row-item:hover .btn.go.small, .row-item.selected .btn.go.small, .row-item.hovered .btn.go.small { opacity: 1; }
.lock-ic { color: #8a5a1e; }
.player-view .lock-ic { display: none; }
.rows .empty { padding: 4px 8px 8px; }

/* Refine */
.refine { margin-top: auto; border-top: 2px solid var(--line); background: var(--panel-2); }
.refine > summary { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; cursor: pointer; list-style: none; font-family: var(--display-font); font-weight: 600; font-size: 16px; }
.refine > summary::-webkit-details-marker { display: none; }
.refine-actions { padding: 0 12px 8px; justify-content: space-between; }
.reframe { margin: 0 12px 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.reframe input[type="range"] { accent-color: var(--stage); }
.reframe p { margin: 4px 0 0; }
.vars-wrap { padding: 0 12px 12px; }
.vars-wrap .var-group { background: var(--panel); }
.var-row input[type="range"] { accent-color: var(--stage); }
.impact.hot { background: var(--stage-soft); color: var(--stage); }
.inline-inspector { padding: 4px 4px 8px; }

/* Inspector slide-over */
.inspector { position: absolute; inset: 0; background: var(--panel); overflow: auto; padding: 10px 14px 16px; animation: slide-in .18s ease-out; box-shadow: -8px 0 24px rgba(50, 35, 15, 0.08); }
@keyframes slide-in { from { transform: translateX(24px); } to { transform: none; } }
.back-btn { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 4px 6px 10px 0; color: var(--stage); font-weight: 600; cursor: pointer; }
.inspector .el-head h2 { font-size: 24px; }
.inspector .el-nav .btn.primary { background: var(--stage); border-color: var(--stage); }

/* Popovers */
.layers-pop { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.layers-pop h3 { font-size: 15px; }
.layers { display: flex; gap: 4px; flex-wrap: wrap; }
.poi-lbl { align-items: flex-start; gap: 6px; line-height: 1.35; color: var(--muted); }
.poi-lbl input { margin-top: 2px; }
.toggle.on { color: var(--stage); border-color: var(--stage); }

/* Modal */
.modal-root[hidden] { display: none; }
.modal-root { position: fixed; inset: 0; z-index: 1200; background: rgba(36, 29, 21, 0.35); display: grid; place-items: center; }
.modal { width: min(560px, 92vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.modal.wide { width: min(760px, 92vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 22px; }
.modal-body { overflow: auto; padding: 14px 20px 20px; }
.about section { margin-top: 14px; }
.about h3 { font-size: 15px; color: var(--stage); margin-bottom: 4px; }
.about p { margin: 0; line-height: 1.5; font-size: 13px; }
.about .lede { font-size: 14px; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 12.5px; }
.keys li { display: flex; align-items: center; gap: 8px; }
.keys kbd { margin: 0; font-size: 11px; padding: 1px 6px; background: var(--panel-2); }
.all-vars .vars { gap: 6px; }

/* Progress and toasts */
.progress { height: 24px; background: rgba(255, 253, 247, 0.96); }
.progress-bar { background: var(--stage); opacity: 0.85; }
.progress-label { font-family: var(--display-font); font-size: 12px; }
.toast { border-left-color: var(--stage); }
