/* Source maps (js/sourcemaps.js, README section 30): the Maps sheet, the spyglass ring, the small bar, the sheet viewer */
#smSheet { position: fixed; z-index: 43; left: 50%; transform: translateX(-50%); bottom: 112px; width: min(560px, calc(100vw - 20px));
  max-height: min(64vh, 640px); overflow-y: auto; padding: 14px 16px; background: var(--ex-paper, #f6f1e4); color: var(--ex-ink, #2a2a20);
  border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); font: 15px/1.45 system-ui, sans-serif; }
#smSheet[hidden], #smBar[hidden], #smLens[hidden], #smSkip[hidden], #smView[hidden] { display: none; }
#smSheet h2 { margin: 0 0 4px; font: 600 21px Georgia, serif; padding-right: 30px; }
#smSheet .exMuted { color: var(--ex-muted, #6d6757); font-size: 14px; margin: 2px 0 10px; }
#smSheet .smClose { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: inherit; }
.smModes { display: flex; gap: 0; border: 1px solid rgba(0,0,0,.2); border-radius: 10px; overflow: hidden; margin: 6px 0 10px; }
.smModes button { flex: 1; padding: 9px 6px; border: 0; border-right: 1px solid rgba(0,0,0,.15); background: #fff; color: inherit; font: 600 15px system-ui, sans-serif; cursor: pointer; }
.smModes button:last-child { border-right: 0; }
.smModes button.on { background: var(--ex-accent, #5d6b3a); color: #fff; }
.smOpts { display: grid; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.smOpts .exMuted { display: inline; margin: 0; font-size: 13px; }
.smCheck { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
.smRange { display: flex; align-items: center; gap: 10px; }
.smRange input { flex: 1; accent-color: var(--ex-accent, #5d6b3a); }
.smLensSize button { width: 34px; height: 30px; margin-left: 4px; border-radius: 8px; border: 1px solid rgba(0,0,0,.2); background: #fff; font: 600 18px/1 system-ui, sans-serif; cursor: pointer; color: inherit; }
.smCards { display: grid; gap: 8px; }
.smCard { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; background: #fff; }
.smCard.on { border-color: var(--ex-accent, #5d6b3a); box-shadow: inset 3px 0 0 var(--ex-accent, #5d6b3a); }
.smCard.open { grid-template-columns: 120px 1fr; }
.smThumb { padding: 0; border: 1px solid rgba(0,0,0,.15); background: #efe8d6; border-radius: 4px; cursor: zoom-in; align-self: start; overflow: hidden; }
.smThumb img { display: block; width: 100%; height: auto; }
.smCard h3 { margin: 0; font: 600 16px/1.25 Georgia, serif; }
.smTitle { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.smTitle:hover { text-decoration: underline; }
.smMeta { margin: 2px 0 4px; color: var(--ex-muted, #6d6757); font-size: 13px; }
.smAcc { white-space: nowrap; color: #4b5a2a; font-weight: 600; }
.smCard dl { margin: 4px 0 6px; font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 2px 8px; }
.smCard dt { color: var(--ex-muted, #6d6757); }
.smCard dd { margin: 0; }
.smRow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.smRow button { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.2); background: #fbfaf5; color: inherit; font: 600 13px system-ui, sans-serif; cursor: pointer; }
.smRow button.on { background: var(--ex-accent, #5d6b3a); color: #fff; border-color: var(--ex-accent, #5d6b3a); }
.smRow a { font-size: 13px; color: #6b4a1e; }
.smOther { margin-top: 10px; font-size: 13px; }
.smOther summary { cursor: pointer; font-weight: 600; }
.smOther ul { margin: 6px 0 0; padding-left: 18px; }
.smOther li { margin: 4px 0; }
.smOther li span { display: block; color: var(--ex-muted, #6d6757); }

/* the spyglass: the map is drawn by the terrain shader; this is its brass ring, a glint and the year plate */
#smLens { position: fixed; left: 0; top: 0; z-index: 30; border-radius: 50%; pointer-events: none; box-sizing: border-box;
  border: 9px solid #b48a46;
  box-shadow: inset 0 0 0 1px #5e4319, inset 0 0 0 3px #e9cf8c, inset 0 6px 18px rgba(0,0,0,.35),
    0 0 0 1px #4a3313, 0 0 0 3px #d9b56a, 0 0 0 4px #5a3f17, 0 6px 18px rgba(0,0,0,.55);
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.16), rgba(255,255,255,0) 32%); will-change: transform; }
#smLens.smTouch { pointer-events: auto; touch-action: none; cursor: grab; }
#smLens .smGlint { position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 200deg, rgba(255,240,200,.0), rgba(255,240,200,.55) 8%, rgba(255,240,200,0) 18%, rgba(0,0,0,0) 60%, rgba(255,240,200,.3) 70%, rgba(255,240,200,0) 78%);
  -webkit-mask: radial-gradient(circle, transparent calc(100% - 10px), #000 calc(100% - 9px)); mask: radial-gradient(circle, transparent calc(100% - 10px), #000 calc(100% - 9px)); }
#smLens .smPlate { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); padding: 1px 9px; border-radius: 4px;
  background: linear-gradient(#e0bf78, #a77b36); color: #3b2808; font: 700 12px Georgia, serif; letter-spacing: .06em; border: 1px solid #5a3f17;
  box-shadow: 0 2px 5px rgba(0,0,0,.4); }

/* the small bar while a map is shown and the sheet is closed */
#smBar { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 42; display: flex; gap: 6px; align-items: center;
  background: rgba(246,241,228,.96); color: #2a2a20; padding: 6px; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.45); font: 14px system-ui, sans-serif; }
#smBar button { padding: 7px 11px; border-radius: 9px; border: 1px solid rgba(0,0,0,.18); background: #fff; color: inherit; font: 600 14px system-ui, sans-serif; cursor: pointer; }
#smBar .smBarName { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#smSkip { position: fixed; right: 18px; bottom: 112px; z-index: 44; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,.25);
  background: rgba(246,241,228,.96); color: #2a2a20; font: 600 15px system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
#smTabFloat { position: fixed; top: 12px; left: 160px; z-index: 41; font: 600 14px system-ui, sans-serif; padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.25); background: #f6f1e4; color: #2a2a20; cursor: pointer; }

/* the whole sheet, larger */
#smView { position: fixed; inset: 0; z-index: 60; background: rgba(10,8,4,.78); overflow-y: auto; padding: 24px 12px; }
.smViewBox { position: relative; max-width: 980px; margin: 0 auto; background: #f6f1e4; color: #2a2a20; border-radius: 12px; padding: 14px 16px 6px; font: 14px/1.45 system-ui, sans-serif; }
.smViewBox h3 { margin: 0 34px 2px 0; font: 600 20px Georgia, serif; }
.smViewBox .smViewClose { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 30px; cursor: pointer; color: inherit; }
.smViewBox figure { margin: 8px 0 12px; }
.smViewBox img { display: block; width: 100%; height: auto; border: 1px solid rgba(0,0,0,.2); }
.smViewBox figcaption { color: #6d6757; font-size: 13px; }

@media (max-width: 760px) {
  #smSheet { bottom: 104px; max-height: 56vh; }
  #smBar { bottom: 104px; max-width: calc(100vw - 20px); }
  #smSkip { bottom: 160px; right: 12px; }
  .smCard.open { grid-template-columns: 84px 1fr; }
  .smCard dl { grid-template-columns: 1fr; }
  .smCard dt { margin-top: 3px; }
}
