/* [storymap] Story Mode's map (storymap.js; the apps' StoryMap.swift). The map's own colours on top of game.css's tokens. */
:root { --sm-grass: #D3EAC6; --sm-tree: #8CC48F; --sm-tree-deep: #6FAE74; --sm-tree-top: #8CC48F; --sm-water: #C3E0F4; --sm-road: #E2DACB; --sm-sand: #F6E3B4; --sm-pent: #FCE7B8;
  --sm-flat: #FFEFD8; --sm-roof2: #D8CBB4; --sm-wall2: #EFE6D6; --sm-pool: #A9CF7A; }
:root[data-theme="dark"] { --sm-grass: #2D4433; --sm-tree: #3F6E4E; --sm-tree-deep: #3F6E4E; --sm-tree-top: #5A8F68; --sm-water: #27445C; --sm-road: #3A3440; --sm-sand: #5A4E36; --sm-pent: #4A3B17;
  --sm-flat: #33293A; --sm-roof2: #4A4038; --sm-wall2: #3B3530; --sm-pool: #3E5A2A; }

#s-levels.sm-on .panel { max-width: 1240px; }
#s-levels .panel-head { flex-wrap: wrap; }
.sm-switch { margin-left: auto; display: inline-flex; padding: 3px; border: var(--edge-w) solid var(--edge); border-radius: var(--r-pill); background: var(--paper); }
.sm-switch button { border: 0; background: none; border-radius: var(--r-pill); padding: 0 12px; min-height: 36px; font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.sm-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.sm-frame { position: relative; margin: 0 auto; max-width: 100%; border: var(--edge-w) solid var(--edge); border-radius: var(--r-card); box-shadow: 0 var(--drop-button) 0 var(--shadow); background: var(--paper); overflow: hidden; }
.sm-view { overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior: contain; scrollbar-width: none; }
.sm-view::-webkit-scrollbar { display: none; }
/* [s6] the sides where the map goes on fade over 16px (storymap.js cut; StoryMap.swift EdgeFade) */
.sm-view.sm-cut-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 16px); mask-image: linear-gradient(to right, transparent, #000 16px); }
.sm-view.sm-cut-r { -webkit-mask-image: linear-gradient(to left, transparent, #000 16px); mask-image: linear-gradient(to left, transparent, #000 16px); }
.sm-view.sm-cut-l.sm-cut-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.sm-map { position: relative; }
.sm-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sm-chap, .sm-label { position: absolute; white-space: nowrap; pointer-events: none; }
.sm-chap { transform: translateY(-50%); background: var(--ink); color: var(--paper); border-radius: var(--r-pill); padding: 3px 8px; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sm-label { transform: translate(-50%, -50%); background: var(--paper); /* ([l4] solid, as the app's ([a4]): the map's lines no longer show through a name) */ border-radius: var(--r-pill); padding: max(1px, calc(1px * var(--lk, 1))) max(5.5px, calc(6px * var(--lk, 1))); font-size: max(11px, calc(12px * var(--lk, 1))); font-weight: 800; color: var(--ink); } /* [bugs35] --lk: below the scale the labels are laid out at (storymap.js K_REF), they shrink with the map, so none grows onto a pin; [s80] but never under 11px (HIG's smallest legible size): storymap.js labelPlan lays them out at that size and leaves off the ones that would collide */
.sm-label[hidden] { display: none; }

.sm-pin { position: absolute; width: var(--d, 40px); height: var(--d, 40px); transform: translate(-50%, -50%); padding: 0; border-radius: 50%;
  border: max(2px, calc(var(--d, 40px) * .07)) solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 0 calc(var(--d, 40px) * .08) 0 var(--shadow);
  display: grid; place-items: center; font-weight: 900; font-size: calc(var(--d, 40px) * .44); line-height: 1; }
.sm-pin::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; } /* (a 44-point target on a small pin) */
.sm-pin:active { transform: translate(-50%, calc(-50% + 3px)); box-shadow: none; }
.sm-next { background: var(--gold); color: #1D1A1F; }
.sm-next::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 5px solid var(--gold); animation: sm-pulse 1.3s ease-out infinite; pointer-events: none; }
@keyframes sm-pulse { from { transform: scale(1); opacity: .95; } to { transform: scale(1.6); opacity: 0; } }
.sm-locked { background: var(--line); border-color: var(--muted); color: var(--muted); box-shadow: none; cursor: default; font-size: calc(var(--d, 40px) * .36); }
.sm-paw { position: absolute; right: -24%; top: -22%; font-size: calc(var(--d, 40px) * .3); }
.sm-stars { position: absolute; top: 100%; left: 50%; transform: translate(-50%, calc(var(--d, 40px) * .1)); display: flex; background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--r-pill); padding: 0 calc(var(--d, 40px) * .1); font-size: calc(var(--d, 40px) * .3); line-height: 1.25; }
.sm-stars i { font-style: normal; color: var(--line); }
.sm-stars i.on { color: var(--gold); }
body.pad .sm-pin:focus-visible, .sm-pin:focus-visible { outline: 4px solid var(--gold); outline-offset: 5px; }

.sm-zoom { display: none; flex: none; gap: 8px; }
.sm-zoomable .sm-zoom { display: flex; }
.sm-zbtn { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); font-size: 22px; font-weight: 900; line-height: 1; padding: 0 0 2px; }
.sm-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sm-legend { flex: 1; font-size: 13px; font-weight: 600; color: var(--muted); }
.sm-surv { width: auto; flex: none; padding: 10px 14px; }

@media (prefers-reduced-motion: reduce) { .sm-next::before { animation: none; transform: scale(1.18); opacity: .9; } }

/* [l1] the map says where to go, not where you can't: a locked pin smaller and quiet (its lock at full strength), the next one standing
   out (a gold halo under it that stays with Reduce Motion, a heavier ink edge, a deeper drop). StoryMap.swift StoryPin the same */
.sm-locked { width: calc(var(--d, 40px) * .72); height: calc(var(--d, 40px) * .72); font-size: calc(var(--d, 40px) * .288); border-width: max(1.5px, calc(var(--d, 40px) * .049)); border-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.sm-locked::after { inset: calc(-8px - var(--d, 40px) * .14); } /* (the 44-point target of the full pin) */
.sm-next { z-index: 2; border-width: max(2.8px, calc(var(--d, 40px) * .098)); box-shadow: 0 calc(var(--d, 40px) * .12) 0 var(--shadow), 0 0 0 calc(var(--d, 40px) * .11) color-mix(in srgb, var(--gold) 35%, transparent); }
html.see-contrast .sm-locked { border-color: var(--muted); }

/* [l2] the star tags: tighter, so neighbours' don't run together (glyphs at most .28 of the pin, at least 10; a hair of overlap), an empty
   star you can see (the muted ink at 55%, not the line colour), and three stars a gold capsule with ink stars: a perfect score at a
   glance. StoryMap.swift StoryPin the same */
.sm-stars { transform: translate(-50%, calc(var(--d, 40px) * .06)); padding: 0 calc(var(--d, 40px) * .06); font-size: max(10px, calc(var(--d, 40px) * .28)); border-width: 1px; letter-spacing: calc(var(--d, 40px) * -.03); }
.sm-stars i { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.sm-stars i.on { color: var(--gold); }
.sm-stars.sm-full { background: var(--gold); }
.sm-stars.sm-full i.on { color: #1D1A1F; }

/* [l3] the map's foot: the legend only what the map doesn't say itself, each item whole (a break only between them); the zoom one chunky
   segmented capsule, as the List | Map switch. StoryMap.swift legend and zoomButtons the same */
.sm-legend { font-size: 12px; display: flex; flex-direction: column; row-gap: 2px; }
.sm-legend > span { white-space: nowrap; } .sm-legend .sm-dot { display: none; } /* (two lines, each whole) */
.sm-zoom { gap: 0; border: var(--edge-w) solid var(--edge); border-radius: var(--r-pill); background: var(--paper); box-shadow: 0 var(--drop-button) 0 var(--shadow); }
.sm-zbtn { width: 44px; height: 38px; border: 0; border-radius: 0; background: none; font-size: 20px; line-height: 38px; padding: 0; }
.sm-zbtn:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); } .sm-zbtn:last-child { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.sm-zbtn:active { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.sm-zbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; position: relative; z-index: 1; }
.sm-zbtn + .sm-zbtn { border-left: 2px solid var(--ink); }

/* [l5] in dark mode the map's scenery outlined in a softer ink (the full ink glowed brighter than the pins); the pins, chapter tags and
   frame keep the full ink; more contrast keeps it everywhere. StoryMap.swift StoryMapArt the same */
[data-theme="dark"] .sm-map { --sm-outline: #A79DAE; }
html.see-contrast .sm-map { --sm-outline: var(--ink); }
