/* ============ The journey maps (js/map.js) ============
   Four illustrated maps, drawn at build time (img/map/*.webp), with the
   roads, stops, pictures and your piece laid over them. The Concert hall
   look is the base here: engraved roads over a cream clearing, brass-rimmed
   stops. html[data-theme="night"] below turns them into the Night sky's
   amber highway and navy medallions, over the night art. */

/* The map's tabs, under the goal: one tap to each map. */
.map-tabs { display: flex; gap: 6px; }
.map-tabs button { flex: 1; min-width: 0; display: inline-flex; justify-content: center; align-items: center; gap: 3px; min-height: 36px; padding: 6px 3px;
  border-radius: 9px; cursor: pointer; border: 1px solid rgba(199, 154, 62, .5); background: rgba(16, 9, 4, .35); color: #e2d3b2;
  font-family: inherit; font-weight: 650; font-size: var(--fs-sm); line-height: 1.1; white-space: nowrap; overflow: hidden; }
.map-tabs button[aria-pressed="true"] { background: #efe5cf; color: #2a1a0e; border-color: #c79a3e; }
.map-tabs button svg { width: 12px; height: 12px; flex: none; }
@media (max-width: 400px) { .map-tabs button { font-size: var(--fs-xs); } }
.map-tabs button:focus-visible { outline: 3px solid #f3d68c; outline-offset: 2px; }

.jmap { position: relative; overflow: hidden; isolation: isolate; background: #e9dcbc; }
.jm-scroller { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; }
.jm-scroller::-webkit-scrollbar { display: none; }
.jm-sizer { position: relative; margin: 0 auto; }
.jm-world { position: absolute; left: 0; top: 0; width: 390px; transform-origin: 0 0; background: #f2e7cc; }
.jm-art { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; }
.jm-grain { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .14 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }
.jm-world.is-locked .jm-art { filter: saturate(.5) brightness(.93); }
.jm-world.is-arriving { animation: jm-arrive .6s cubic-bezier(.2, .7, .3, 1); }
@keyframes jm-arrive { from { opacity: 0; translate: 0 40px; } }
.jm-roads { position: absolute; inset: 0; width: 100%; height: 100%; }
.jm-items { position: absolute; inset: 0; }

/* Roads: an engraved double line over the cream clearing cut into the art.
   Locked: quiet, a faint road with a dashed trace. Open: bright gold with
   footsteps, glowing toward the next stop. Walked: gilded, with a shine. */
.jm-roads .road { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.jm-roads .road.edge { stroke: #2b1c0e; stroke-width: 9; }
.jm-roads .road.edge.locked { stroke-width: 7.4; stroke-opacity: .34; }
.jm-roads .road.bed { stroke: #f7eed8; stroke-width: 5.6; }
.jm-roads .road.trace { stroke: #2b1c0e; stroke-width: 1.5; stroke-dasharray: 3.5 4; stroke-opacity: .6; }
.jm-roads .road.next { stroke: #ffcf5c; stroke-width: 20; stroke-opacity: .35; animation: jm-roadglow 1.8s ease-in-out infinite; }
@keyframes jm-roadglow { 50% { stroke-opacity: .65; } }
.jm-roads .road.bright { stroke: #f7d06a; stroke-width: 6.4; }
.jm-roads .road.steps { stroke: #5e3a12; stroke-width: 2.2; stroke-dasharray: 0 7.5; }
.jm-roads .road.glow { stroke: #ffd36b; stroke-width: 14; stroke-opacity: .3; }
.jm-roads .road.gold { stroke: #d49a33; stroke-width: 6.4; }
.jm-roads .road.shine { stroke: #fff2c8; stroke-width: 1.5; stroke-opacity: .9; }

/* A path's picture in a brass frame, its name on a ribbon; its state as a seal, a glow or a dimmed picture. */
.jm-region { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; width: 100px; z-index: 2;
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.jm-region.jm-end { cursor: default; pointer-events: none; }
.jm-pic { position: relative; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 2.5px solid #c79a3e; background: #e2d3b2;
  box-shadow: 0 0 0 1.4px #2b1c0e, 0 0 0 4px #f4e9cf, 0 0 0 5.2px rgba(43, 28, 14, .7), 0 5px 9px rgba(40, 25, 5, .45); }
.jm-region.composer .jm-pic { border-radius: 9px; width: 50px; height: 56px; }
.jm-pic img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) contrast(1.05); display: block; }
.jm-name { position: relative; isolation: isolate; margin-top: 7px; padding: 3px 13px 5px; white-space: nowrap;
  font: 400 16px/1 'Great Vibes', 'Snell Roundhand', cursive; color: #2a1a0e; }
.jm-name::before, .jm-name::after { content: ""; position: absolute; z-index: -1; clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%, 7px 50%); }
.jm-name::before { inset: 0; background: #2b1c0e; }
.jm-name::after { inset: 1.2px 1.6px; background: linear-gradient(#fbf3de, #e8d5ab); clip-path: polygon(0 0, 100% 0, calc(100% - 6.2px) 50%, 100% 100%, 0 100%, 6.2px 50%); }
.jm-pips { display: flex; gap: 3px; margin-top: 3px; }
.jm-pips i { width: 6px; height: 6px; border-radius: 50%; background: #2b1c0e; box-shadow: 0 0 0 1.2px #f4e9cf; }
.jm-pips i.off { background: #f4e9cf; box-shadow: inset 0 0 0 1.2px #2b1c0e, 0 0 0 1.2px #f4e9cf; }
.jm-seal { position: absolute; top: 30px; left: calc(50% + 14px); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  box-shadow: 0 0 0 1.4px #2b1c0e, 0 2px 4px rgba(40, 25, 5, .45); }
.jm-region.composer .jm-seal { top: 36px; }
.jm-seal svg { width: 12px; height: 12px; }
.jm-seal.lock { background: radial-gradient(circle at 40% 35%, #efe2c3, #b9a682); color: #4a3a26; }
.jm-seal.paid { background: radial-gradient(circle at 40% 35%, #c9574a, #7d1c1f 75%); color: #fbe7c8; }
.jm-seal.done, .jm-seal.mine { background: radial-gradient(circle at 40% 35%, #fff1c2, #dca540 60%, #9a6512); color: #3a2208; }
.jm-region.is-locked .jm-pic img { filter: grayscale(1) sepia(.25) brightness(.8); }
.jm-region.is-locked .jm-name { color: #6b5638; }
.jm-region.is-done .jm-pic { border-color: #f0cf73; box-shadow: 0 0 0 1.4px #2b1c0e, 0 0 0 4px #f4e9cf, 0 0 0 5.2px rgba(43, 28, 14, .7), 0 0 16px 4px rgba(240, 200, 100, .8); }
.jm-region.is-choice .jm-pic { animation: jm-choice 1.6s ease-in-out infinite; }
@keyframes jm-choice { 50% { box-shadow: 0 0 0 1.4px #2b1c0e, 0 0 0 4px #fff4d6, 0 0 0 5.2px rgba(43, 28, 14, .7), 0 0 20px 7px rgba(255, 205, 100, .95); } }
.jm-region.is-new .jm-pic { animation: jm-new 1.3s ease-in-out 2; }
@keyframes jm-new { 50% { scale: 1.18; box-shadow: 0 0 0 1.4px #2b1c0e, 0 0 0 4px #fff4d6, 0 0 0 5.2px rgba(43, 28, 14, .7), 0 0 26px 10px rgba(255, 205, 100, .95); } }
.jm-region:focus-visible { outline: none; }
.jm-region:focus-visible .jm-pic { outline: 3px solid #2f4c86; outline-offset: 4px; }

/* Stops: brass-rimmed medallions. Walked: dark with a gold number. Next:
   gilded and glowing. Locked: plain parchment. Each has a 44px tap area. */
.jm-stop { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: grid; place-items: center; font: 700 16px/1 'Cormorant Garamond', Georgia, serif; font-variant-numeric: lining-nums; color: #f6dc98;
  background: radial-gradient(circle at 50% 36%, #563a22, #1e1309 72%); box-shadow: 0 0 0 1.6px #c79a3e, 0 0 0 3px #2b1c0e, 0 3px 5px rgba(40, 25, 5, .5);
  cursor: pointer; padding: 0; z-index: 3; -webkit-tap-highlight-color: transparent; }
.jm-stop::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.jm-stop.recital { border-radius: 5px; transform: translate(-50%, -50%) rotate(45deg); width: 25px; height: 25px; }
.jm-stop.recital > span:first-child { transform: rotate(-45deg); display: grid; place-items: center; }
.jm-stop.big { width: 40px; height: 40px; }
.jm-stop.is-open { color: #2b1c0e; background: radial-gradient(circle at 50% 30%, #fff3cc, #ebbb5c 55%, #a66a14);
  box-shadow: 0 0 0 1.6px #fff4d6, 0 0 0 3px #2b1c0e, 0 0 14px 5px rgba(255, 205, 100, .8); animation: jm-beckon 1.8s ease-in-out infinite; }
@keyframes jm-beckon { 50% { box-shadow: 0 0 0 1.6px #fff4d6, 0 0 0 3px #2b1c0e, 0 0 22px 9px rgba(255, 205, 100, .95); } }
.jm-stop.is-locked { color: #7d6b4e; background: radial-gradient(circle at 50% 35%, #f6ecd2, #dccaa2);
  box-shadow: 0 0 0 1.2px rgba(43, 28, 14, .55), 0 0 0 2.6px rgba(244, 233, 207, .9), 0 2px 3px rgba(40, 25, 5, .25); }
.jm-stop svg { width: 14px; height: 14px; }
.jm-stop.big svg { width: 21px; height: 21px; }
.jm-stop:focus-visible { outline: 3px solid #2f4c86; outline-offset: 4px; }
.jm-stop.station { width: 46px; height: 46px; color: #2b1c0e; background: radial-gradient(circle at 50% 30%, #fff3cc, #ebbb5c 55%, #a66a14);
  box-shadow: 0 0 0 1.8px #fff4d6, 0 0 0 3.4px #2b1c0e, 0 4px 9px rgba(40, 25, 5, .45); animation: none; }
.jm-stop.station svg { width: 25px; height: 25px; }
.jm-stop.station.is-soon { background: rgba(246, 236, 210, .85); color: #7d6b4e; box-shadow: none; outline: 2px dashed rgba(43, 28, 14, .55); outline-offset: -2px; }
.jm-stop.is-popping { animation: jm-pop .7s cubic-bezier(.3, 1.6, .5, 1) 2; }
@keyframes jm-pop { 50% { scale: 1.35; } }
.jm-stop.recital.is-popping { animation-name: jm-pop-r; }
@keyframes jm-pop-r { 50% { transform: translate(-50%, -50%) rotate(45deg) scale(1.35); } }
/* Passed on your own instrument: its little picture on the stop's shoulder. */
.jm-real { position: absolute; right: -9px; top: -11px; width: 12px; height: 20px; display: grid; place-items: center; pointer-events: none; }
.jm-real svg { width: 100%; height: 100%; }
.jm-stop.recital .jm-real { transform: rotate(-45deg); }
.jm-stop-name { position: absolute; transform: translate(-50%, 0); z-index: 2; pointer-events: none; white-space: nowrap;
  font: 700 12.5px/1 'Cormorant Garamond', Georgia, serif; color: #2a1a0e; background: #f6ecd3; padding: 2px 7px 3px; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(43, 28, 14, .8), 0 0 0 2.6px #f6ecd3, 0 0 0 3.3px rgba(43, 28, 14, .45), 0 2px 5px rgba(40, 25, 5, .3); }

/* Your instrument, standing on a little brass base, like a game piece. */
.jm-marker { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 5; pointer-events: none; }
.jm-piece { position: absolute; left: -30px; top: -84px; width: 60px; height: 92px; display: grid; justify-items: center; align-content: end; }
.jm-inst { position: relative; z-index: 2; height: 96px; margin-bottom: -16px; filter: drop-shadow(2px 3px 2px rgba(40, 20, 5, .45));
  animation: jm-bob 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.jm-inst svg { height: 100%; width: auto; display: block; }
.jm-base { position: absolute; bottom: 0; width: 44px; height: 15px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #fff1c4, #d9a441 55%, #8a5a10); box-shadow: 0 3px 0 #5a3a08, 0 6px 8px rgba(40, 20, 5, .35); }
.jm-base::after { content: ""; position: absolute; inset: -5px -7px; border-radius: 50%; border: 3px solid #ffd27a; animation: jm-ring 1.5s ease-out infinite; }
.jm-base::before { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: jm-glow 1.5s ease-in-out infinite; }
.jm-marker.is-walking .jm-inst { animation: jm-hop .32s ease-in-out infinite; }
.jm-marker.is-walking .jm-base::after { animation: none; opacity: 0; }
@keyframes jm-bob { 50% { translate: 0 -4px; rotate: -3deg; } }
@keyframes jm-hop { 50% { translate: 0 -8px; } }
@keyframes jm-ring { from { scale: 1; opacity: .9; } to { scale: 1.9; opacity: 0; } }
@keyframes jm-glow { 50% { box-shadow: 0 0 18px 6px rgba(255, 196, 80, .85); } }

.jm-bursts { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.jm-spark { position: absolute; width: 7px; height: 7px; border-radius: 2px; animation: jm-spark 1.6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes jm-spark { from { transform: translate(-50%, -50%) rotate(0); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(400deg); opacity: 0; } }

/* Over the map: the free composer's token, and today's warm-up. */
.jm-free { position: absolute; top: 10px; right: max(10px, var(--safe-r)); z-index: 6; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; font: 700 13px/1 var(--sans, system-ui); color: #2a1a0e; background: linear-gradient(#fff4d0, #f0c25a);
  border: 1px solid #8a5a10; box-shadow: 0 2px 8px rgba(40, 25, 5, .35), 0 0 12px rgba(240, 194, 90, .5); pointer-events: none; }
.jm-free[hidden], .jm-warmup[hidden] { display: none; }
.jm-free svg { width: 16px; height: 16px; }
.jm-warmup { position: absolute; left: max(10px, var(--safe-l)); bottom: calc(12px + var(--safe-b)); z-index: 6; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid #8a5a10; cursor: pointer; font: 700 var(--fs-sm)/1 var(--sans, system-ui);
  color: #fbf3df; background: linear-gradient(#7a4a1e, #4a2a10); box-shadow: 0 3px 0 #2a1708, 0 4px 12px rgba(40, 25, 5, .45); }
.jm-warmup svg { width: 18px; height: 18px; color: #ffd27a; }
.jm-warmup:active { transform: translateY(2px); box-shadow: 0 1px 0 #2a1708; }

@media (prefers-reduced-motion: reduce) {
  .jm-roads .road.next, .jm-stop.is-open, .jm-region.is-choice .jm-pic, .jm-region.is-new .jm-pic, .jm-inst, .jm-base::after, .jm-base::before,
  .jm-marker.is-walking .jm-inst, .jm-world.is-arriving, .jm-stop.is-popping { animation: none; }
}

/* ----- the Night sky look: the app's navy panels, amber accent and neon highway ----- */
html[data-theme="night"] .map-tabs button { border-color: #2a3550; background: rgba(26, 34, 54, .6); color: #93a0bd; }
html[data-theme="night"] .map-tabs button[aria-pressed="true"] { background: linear-gradient(180deg, #f5a524, #ff7a1a); border-color: #b06000; color: #221200; }
html[data-theme="night"] .map-tabs button:focus-visible { outline-color: #f5a524; }
/* A wide screen (a desktop, a tablet on its side): the map stops growing
   (map.js MAX_SCALE) and sits like a sheet on the desk, with the walnut
   around it and a shadow under it, not bare paper to the window's edges. */
@media (min-width: 720px) and (min-aspect-ratio: 1/1) {
  html[data-theme="concert"] .jmap { background: radial-gradient(ellipse 70% 80% at 50% 40%, rgba(255, 210, 160, .06), rgba(0, 0, 0, .42)), var(--walnut) center / 700px, #2a160a; }
  .jm-world { box-shadow: 0 0 0 1px rgba(20, 10, 3, .45), 0 24px 70px rgba(0, 0, 0, .55); }
}
html[data-theme="night"] .jmap { background: #0b0f1a; }
html[data-theme="night"] .jm-world { background: #121a2c; }
html[data-theme="night"] .jm-grain { display: none; }
html[data-theme="night"] .jm-world.is-locked .jm-art { filter: saturate(.55) brightness(.78); }
html[data-theme="night"] .jm-free { color: #221200; background: linear-gradient(180deg, #f5a524, #ff7a1a); border-color: #b06000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 14px rgba(245, 165, 36, .55); }
html[data-theme="night"] .jm-warmup { color: #e8ecf5; background: linear-gradient(180deg, #1a2236, #131a2b); border-color: rgba(245, 165, 36, .7);
  box-shadow: 0 3px 0 #04060c, 0 4px 12px rgba(0, 0, 0, .5); }
html[data-theme="night"] .jm-warmup svg { color: #f5a524; }
/* Night roads: locked, a dark lane with a pale dashed trace; open, the amber neon highway; walked, bright gold with a shine. */
html[data-theme="night"] .jm-roads .road.edge { stroke: #04060c; }
html[data-theme="night"] .jm-roads .road.edge.locked { stroke-opacity: .7; }
html[data-theme="night"] .jm-roads .road.bed { stroke: #222c45; }
html[data-theme="night"] .jm-roads .road.trace { stroke: #93a0bd; stroke-opacity: .75; }
html[data-theme="night"] .jm-roads .road.next { stroke: #ff9a2e; stroke-opacity: .4; }
html[data-theme="night"] .jm-roads .road.bright { stroke: #f5a524; }
html[data-theme="night"] .jm-roads .road.steps { stroke: #4a2200; }
html[data-theme="night"] .jm-roads .road.glow { stroke: #ff8a1f; stroke-opacity: .45; }
html[data-theme="night"] .jm-roads .road.gold { stroke: #ffb547; }
html[data-theme="night"] .jm-roads .road.shine { stroke: #fff4d6; }
html[data-theme="night"] .jm-pic { border-color: #f5a524; background: #1a2236;
  box-shadow: 0 0 0 1.4px #04060c, 0 0 0 4px #1a2236, 0 0 0 5.2px #2a3550, 0 5px 9px rgba(0, 0, 0, .6); }
html[data-theme="night"] .jm-pic img { filter: saturate(.85) contrast(1.05); }
html[data-theme="night"] .jm-name { color: #e8ecf5; font: 700 13px/1 var(--sans, system-ui); padding: 4px 13px 5px; }
html[data-theme="night"] .jm-name::before { background: #2a3550; }
html[data-theme="night"] .jm-name::after { background: linear-gradient(#222d48, #151d31); }
html[data-theme="night"] .jm-pips i { background: #f5a524; box-shadow: 0 0 0 1.2px #04060c; }
html[data-theme="night"] .jm-pips i.off { background: #1a2236; box-shadow: inset 0 0 0 1.2px #93a0bd, 0 0 0 1.2px #04060c; }
html[data-theme="night"] .jm-seal { box-shadow: 0 0 0 1.4px #04060c, 0 2px 4px rgba(0, 0, 0, .6); }
html[data-theme="night"] .jm-seal.lock { background: radial-gradient(circle at 40% 35%, #34415f, #1a2236); color: #c9d3ea; }
html[data-theme="night"] .jm-seal.done, html[data-theme="night"] .jm-seal.mine { background: radial-gradient(circle at 40% 35%, #ffe3a0, #f5a524 60%, #b4560a); color: #221200; }
html[data-theme="night"] .jm-region.is-locked .jm-pic img { filter: grayscale(1) brightness(.62); }
html[data-theme="night"] .jm-region.is-locked .jm-name { color: #93a0bd; }
html[data-theme="night"] .jm-region.is-done .jm-pic { border-color: #ffcf6a; box-shadow: 0 0 0 1.4px #04060c, 0 0 0 4px #1a2236, 0 0 0 5.2px #2a3550, 0 0 16px 4px rgba(245, 165, 36, .75); }
html[data-theme="night"] .jm-region.is-choice .jm-pic { animation-name: jm-choice-n; }
@keyframes jm-choice-n { 50% { box-shadow: 0 0 0 1.4px #04060c, 0 0 0 4px #1a2236, 0 0 0 5.2px #2a3550, 0 0 20px 7px rgba(245, 165, 36, .9); } }
html[data-theme="night"] .jm-stop { color: #ffcf6a; background: radial-gradient(circle at 50% 36%, #2c3956, #0b0f1a 72%);
  box-shadow: 0 0 0 1.6px #f5a524, 0 0 0 3px #04060c, 0 3px 5px rgba(0, 0, 0, .6); font-family: var(--sans, system-ui); font-size: 14px; }
html[data-theme="night"] .jm-stop.is-open, html[data-theme="night"] .jm-stop.station { color: #221200; background: radial-gradient(circle at 50% 30%, #ffe6ad, #f5a524 55%, #c25a08); }
html[data-theme="night"] .jm-stop.is-open { box-shadow: 0 0 0 1.6px #ffe0a0, 0 0 0 3px #04060c, 0 0 14px 5px rgba(245, 165, 36, .75); animation-name: jm-beckon-n; }
@keyframes jm-beckon-n { 50% { box-shadow: 0 0 0 1.6px #ffe0a0, 0 0 0 3px #04060c, 0 0 22px 9px rgba(255, 150, 40, .9); } }
html[data-theme="night"] .jm-stop.station { box-shadow: 0 0 0 1.8px #ffe0a0, 0 0 0 3.4px #04060c, 0 4px 9px rgba(0, 0, 0, .6); }
html[data-theme="night"] .jm-stop.is-locked { color: #93a0bd; background: radial-gradient(circle at 50% 35%, #26314c, #1a2236);
  box-shadow: 0 0 0 1.2px #2a3550, 0 0 0 2.6px #04060c, 0 2px 3px rgba(0, 0, 0, .5); }
html[data-theme="night"] .jm-stop.station.is-soon { background: rgba(26, 34, 54, .85); color: #93a0bd; box-shadow: none; outline-color: rgba(147, 160, 189, .7); }
html[data-theme="night"] .jm-stop:focus-visible, html[data-theme="night"] .jm-region:focus-visible .jm-pic { outline-color: #f5a524; }
html[data-theme="night"] .jm-stop-name { color: #e8ecf5; background: #131a2b; font-family: var(--sans, system-ui); font-size: 12px;
  box-shadow: 0 0 0 1px #2a3550, 0 0 0 2.6px #131a2b, 0 0 0 3.3px rgba(42, 53, 80, .8), 0 2px 5px rgba(0, 0, 0, .5); }
html[data-theme="night"] .jm-inst { filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, .6)); }
html[data-theme="night"] .jm-base { background: radial-gradient(ellipse at 50% 35%, #ffe6ad, #f5a524 55%, #a8500a); box-shadow: 0 3px 0 #5a2c04, 0 6px 8px rgba(0, 0, 0, .5); }
html[data-theme="night"] .jm-base::after { border-color: #ffb547; }
html[data-theme="night"] .jm-base::before { animation-name: jm-glow-n; }
@keyframes jm-glow-n { 50% { box-shadow: 0 0 18px 6px rgba(255, 150, 40, .85); } }

/* Even when nothing else moves (main.js idle), your piece keeps breathing, so the eye finds it (Doug). */
html.is-idle .jm-inst, html.is-idle .jm-base::after, html.is-idle .jm-base::before { animation-play-state: running !important; }

/* Phones sideways: the goal and the tabs side by side, so the map keeps its height. */
@media (orientation: landscape) and (max-height: 600px) {
  #screen-map .map-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 10px; }
  #screen-map .map-goal span { -webkit-line-clamp: 1; line-clamp: 1; }
}
