/* THE MARS CHART'S LOOK (05-13 AT-09), shared by the home page and the Mars Atlas page.
   Step 1. The sheet: the printed map, its two plates (ancient sea and dry), and the drawing on top.
   Step 2. Motion: the shore inking itself in, the sea draining (a canvas laid over the sheets), routes drawing out, ships
           hopping along them, the first ship coming down, pins dropping with a ripple, the city's glow, and a slow beat
           round the visitor's home. Less motion: none of it.
   Step 3. The time ribbon: a line with one stop per era, a fill that follows time, and a play button.
   Step 4. The place card that opens beside a tapped place, printed like the map. The night shade, the Sun mark and the
           settlements' lights (Step 1) are drawn live by chart.js.
   Step 6. The living atlas (05-13 AT-24, AT-25): the corner with its Live badge, Spin a day and the lens button; the
           Sun's chevrons, frost crystals, storm haze, gliding moons and Phobos's shadow; inked routes and wax seals;
           the impact replays; and the brass lens.
   Colours come from 05-13's numbers.chart, set on the chart as --wc-ink and --wc-paper. */

/* Step 1. The sheet */
.wc { --wc-ink: #3B2E22; --wc-paper: #EEE2C6; color: var(--wc-ink); }
.wc-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--wc-ink) 35%, transparent) transparent; }
.wc-sheet { position: relative; aspect-ratio: 780 / 412; }
.wc-hint { margin: 8px 0 0; font: italic 13px var(--wum-body, sans-serif); opacity: 0.85; text-align: center; }
/* On a phone: say clearly, above and below, that the chart slides sideways */
.wc-swipe { display: none; }
@media (max-width: 700px) {
  .wc-sheet { width: 820px; } .wc-hint { display: none; }
  .wc-swipe { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--wc-ink); }
  .wc-swipe-top { margin: 0 0 8px; justify-content: space-between; }
  .wc-swipe-bot { flex-direction: column; gap: 7px; margin: 9px 0 0; }
  .wc-sw-txt { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1.2 var(--wum-display, sans-serif); letter-spacing: 0.1em; text-transform: uppercase; text-align: center; }
  .wc-swipe-bot .wc-sw-txt { font: italic 13px/1.35 var(--wum-body, sans-serif); letter-spacing: 0; text-transform: none; opacity: 0.8; }
  .wc-sw-txt i { font-style: normal; display: inline-block; animation: wcNudgeL 1.6s ease-in-out infinite; }
  .wc-sw-txt i + i, .wc-sw-txt i:last-child { animation-name: wcNudgeR; }
  .wc-sw-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
    color: var(--wc-paper); background: var(--wc-ink); border: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: opacity 0.25s; }
  .wc-sw-btn svg { width: 18px; height: 18px; }
  .wc-sw-btn:disabled { opacity: 0.25; cursor: default; }
  .wc-sw-track { position: relative; width: 72%; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--wc-ink) 18%, transparent); overflow: hidden; }
  .wc-sw-thumb { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--wc-ink); transition: left 0.08s linear; }
}
@keyframes wcNudgeL { 50% { transform: translateX(-4px); } }
@keyframes wcNudgeR { 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .wc-sw-txt i { animation: none; } }
.wc-img { position: absolute; left: calc(30 / 780 * 100%); top: calc(26 / 412 * 100%); width: calc(720 / 780 * 100%); height: calc(360 / 412 * 100%);
  display: block; transition: opacity 1.6s ease; mix-blend-mode: multiply; }
.wc-ancient { opacity: 0; }
.wc-sheet.is-ancient .wc-ancient { opacity: 1; }
.wc-water { opacity: 0; transition: none; pointer-events: none; }
.wc-night { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.wc-night.on { opacity: 1; }
.wc-relief { opacity: 0; mix-blend-mode: soft-light; transition: opacity 1.6s ease; pointer-events: none; }
.wc-relief.on { opacity: 1; }
.wc-place { cursor: pointer; transition: opacity 0.6s; }
.wc-place.wc-under { opacity: 0; pointer-events: none; }
.wc-place:hover text, .wc-place:focus-visible text { fill: #A34A26; fill-opacity: 1; }
.wc-place:focus, .wc-pin:focus { outline: none; }
.wc-lights { mix-blend-mode: screen; pointer-events: none; animation: wcLights 4s ease-in-out infinite alternate; }
@keyframes wcLights { 0% { opacity: 0.7; } 30% { opacity: 1; } 55% { opacity: 0.85; } 80% { opacity: 1; } 100% { opacity: 0.75; } }
.wc-sun, .wc-daypool, .wc-moons { pointer-events: none; }
/* the live Sun (05-13 AT-19): its Live tag can be tapped, its light pulses, the sunset line shimmers */
.wc-sun .wc-sun-tap { pointer-events: auto; cursor: pointer; }
.wc-sun-tap:focus { outline: none; }
.wc-sun-tap:hover rect, .wc-sun-tap:focus-visible rect { fill-opacity: 1; stroke-width: 1.1; }
.wc-live-dot { transform-box: fill-box; transform-origin: center; animation: wcLiveDot 1.6s ease-out infinite; }
@keyframes wcLiveDot { 0% { opacity: 1; transform: scale(1); } 60% { opacity: 0.35; transform: scale(1.5); } 100% { opacity: 1; transform: scale(1); } }
.wc-edges, .wc-suntrack { pointer-events: none; }
.wc-edge-glow { animation: wcEdge 3.6s ease-in-out infinite; }
@keyframes wcEdge { 50% { stroke-opacity: 0.55; } }
.wc-live-pip { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #FF4B3E; box-shadow: 0 0 0 0 rgba(255,75,62,.6); animation: wcLive 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .wc-live-dot, .wc-edge-glow, .wc-live-pip { animation: none; } }
.wc-daypool { mix-blend-mode: screen; }
.wc-sun-halo { transform-box: fill-box; transform-origin: center; animation: wcSunBreathe 3.2s ease-in-out infinite; }
.wc-sun-rays { transform-box: fill-box; transform-origin: center; animation: wcSunTurn 40s linear infinite; }
@keyframes wcSunBreathe { 0%, 100% { transform: scale(0.85); opacity: 0.8; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes wcSunTurn { to { transform: rotate(360deg); } }
.wc-water.on { opacity: 1; }
.wc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wc-pin { cursor: pointer; }
.wc-pin:focus-visible { outline: none; }
.wc-pin:focus-visible circle:nth-last-of-type(1) { stroke: var(--wc-ink); stroke-width: 1.4; }
.wc-faint { opacity: 0.6; }
.wc-err { padding: 24px; font-family: var(--wum-body); }

/* Step 2. Motion */
.wc-waiting .wc-shore, .wc-waiting .wc-moment text { opacity: 0; }
.wc-waiting .wc-img { opacity: 0; }
.wc-draw { stroke-dashoffset: 1; animation: wcInk 2.4s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes wcInk { to { stroke-dashoffset: 0; } }
.wc-route-in { stroke-dashoffset: 0; animation: wcRoute 1.1s ease-out both; }
@keyframes wcRoute { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.wc-pop { animation: wcPop 0.5s 0.7s cubic-bezier(.2, .9, .3, 1.4) both; transform-box: fill-box; transform-origin: center; }
@keyframes wcPop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
.wc-drop { animation: wcDrop 0.6s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes wcDrop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.wc-ripple { transform-box: fill-box; transform-origin: center; animation: wcRipple 1.6s 0.35s ease-out both; }
@keyframes wcRipple { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(5); } }
.wc-home { transform-box: fill-box; transform-origin: center; animation: wcHome 2.4s 1s ease-out infinite; pointer-events: none; }
@keyframes wcHome { 0% { opacity: 0.75; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.8); } }
.wc-ship { opacity: 0; animation: wcFade 0.8s 1.2s ease both; pointer-events: none; }
@keyframes wcFade { to { opacity: 1; } }
.wc-glow { pointer-events: none; animation: wcGlowIn 1.6s ease both; }
@keyframes wcGlowIn { from { opacity: 0; } }
.wc-streak { stroke-dashoffset: 0.4; animation: wcStreak 0.9s cubic-bezier(.5, 0, .9, .6) forwards; pointer-events: none; }
@keyframes wcStreak { 0% { stroke-dashoffset: 0.4; opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0; } }
.wc-after-landing.wc-drop, .wc-after-landing .wc-ripple { animation-delay: 0.75s; }
@media (prefers-reduced-motion: reduce) { .wc-img { transition: none; } .wc-draw, .wc-route-in, .wc-pop, .wc-drop, .wc-ripple, .wc-home, .wc-glow, .wc-ship { animation: none; } .wc-home { opacity: 0; } .wc-ship { opacity: 1; } }

/* Step 3. The time ribbon */
.wc-ribbon { display: flex; align-items: center; gap: 14px; margin-top: 14px; --wc-progress: 0%; --wc-era: var(--wc-ink); }
.wc-play { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--wc-ink); background: transparent; color: var(--wc-ink);
  display: grid; place-items: center; cursor: pointer; transition: background 0.2s, color 0.2s; }
.wc-play svg { width: 16px; height: 16px; fill: currentColor; margin-left: 2px; }
.wc-play.on svg { margin: 0; }
.wc-play { position: relative; }
.wc-play::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: conic-gradient(var(--wc-ink) calc(var(--wc-turn, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 2.5px), #000 calc(50% - 2px));
  mask: radial-gradient(circle, transparent calc(50% - 2.5px), #000 calc(50% - 2px)); }
@property --wc-turn { syntax: '<number>'; inherits: false; initial-value: 0; }
.wc-play.tick::after { opacity: 0.85; animation: wcTurn var(--wc-dwell, 9s) linear forwards; }
@keyframes wcTurn { from { --wc-turn: 0; } to { --wc-turn: 1; } }
.wc-play:hover, .wc-play:focus-visible { background: var(--wc-ink); color: var(--wc-paper); outline: none; }
.wc-track { position: relative; flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px 2px 2px; }
.wc-track::-webkit-scrollbar { display: none; }
.wc-line, .wc-fill { position: absolute; left: calc(100% / (2 * var(--wc-n, 7))); right: calc(100% / (2 * var(--wc-n, 7))); top: 13px; height: 2px;
  background: color-mix(in srgb, var(--wc-ink) 22%, transparent); border-radius: 2px; }
.wc-fill { background: var(--wc-ink); transform-origin: left center; transform: scaleX(var(--wc-p, 0)); transition: transform 0.8s cubic-bezier(.4, 0, .2, 1); }
.wc-stop { position: relative; flex: 1 0 84px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0 4px; cursor: pointer;
  color: var(--wc-ink); font: inherit; text-align: center; }
.wc-stop i { width: 13px; height: 13px; border-radius: 50%; background: var(--wc-paper); border: 2px solid color-mix(in srgb, var(--wc-ink) 45%, transparent); transition: transform 0.3s, background 0.3s, border-color 0.3s; z-index: 1; }
.wc-stop b { font: 600 13px/1.1 var(--wum-display, sans-serif); letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.78; transition: opacity 0.3s; white-space: nowrap; }
.wc-stop small { font: 400 10.5px var(--wum-mono, monospace); opacity: 0.72; white-space: nowrap; }
.wc-stop[aria-pressed="true"] i { background: var(--c); border-color: var(--wc-ink); transform: scale(1.35); }
.wc-stop[aria-pressed="true"] b { opacity: 1; }
.wc-stop:hover b, .wc-stop:focus-visible b { opacity: 1; }
.wc-stop:focus-visible { outline: none; }
.wc-stop:focus-visible i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--wc-ink) 30%, transparent); }

/* Step 4. The place card: a small printed card that opens beside a tapped place */
.wc-card { position: absolute; z-index: 5; width: 262px; padding: 14px 16px 14px; border-radius: 4px; color: var(--wc-ink);
  background: var(--wc-paper); border: 1px solid color-mix(in srgb, var(--wc-ink) 45%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 18px 40px -12px rgba(59,46,34,.45), 0 3px 10px rgba(59,46,34,.18); }
.wc-card::before { content: ""; position: absolute; inset: 4px; border: 1px solid color-mix(in srgb, var(--wc-ink) 22%, transparent); border-radius: 2px; pointer-events: none; }
.wc-card[hidden] { display: none; }
.wc-card-in { animation: wcCardIn 0.35s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes wcCardIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.wc-card h4 { margin: 2px 26px 0 0; font: 700 22px/1 var(--wum-display, sans-serif); text-transform: uppercase; letter-spacing: 0.01em; }
.wc-c-kick { margin: 0; font: 500 10px/1.3 var(--wum-mono, monospace); letter-spacing: 0.14em; text-transform: uppercase; color: #A34A26; display: flex; align-items: center; gap: 8px; }
.wc-c-kick em { font: 700 9px/1 var(--wum-display, sans-serif); font-style: normal; letter-spacing: 0.12em; padding: 3px 7px 2px; border-radius: 999px; color: #FFF7EF; background: #B4502B; }
.wc-c-sci { margin: 3px 0 0; font: italic 13px var(--wum-body, sans-serif); opacity: 0.75; }
.wc-c-line { margin: 8px 0 0; font: 14px/1.42 var(--wum-body, sans-serif); color: color-mix(in srgb, var(--wc-ink) 88%, transparent); }
.wc-c-big { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; margin: 10px 0 2px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--wc-ink) 22%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--wc-ink) 22%, transparent); }
.wc-c-big:not(:has(svg)) { grid-template-columns: 1fr; }
.wc-c-big .viz { width: 84px; height: 66px; display: block; overflow: visible; }
.wc-c-big b { display: block; font: 700 30px/1 var(--wum-display, sans-serif); }
.wc-c-big b small { font-size: 0.5em; }
.wc-c-big span { display: block; margin-top: 3px; font: 13px/1.35 var(--wum-body, sans-serif); color: color-mix(in srgb, var(--wc-ink) 82%, transparent); }
.wc-c-row { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0 0; font: 13px/1.35 var(--wum-body, sans-serif); }
.wc-c-row span { white-space: nowrap; font: 500 10px/1.6 var(--wum-mono, monospace); letter-spacing: 0.12em; text-transform: uppercase; color: #A34A26; }
.wc-c-row b { text-align: right; }
.wc-c-earth { display: flex; gap: 9px; align-items: flex-start; margin: 10px 0 0; padding: 9px 10px; border-radius: 4px; background: color-mix(in srgb, #9DBACB 22%, transparent); font: 600 13.5px/1.4 var(--wum-body, sans-serif); color: var(--wc-ink); }
.wc-c-earth svg { flex: none; margin-top: 1px; }
/* the place's story: how it came to be (02-04 'story'), in warm gold beside the cool Earth line */
.wc-c-story { display: flex; gap: 9px; align-items: flex-start; margin: 8px 0 0; padding: 9px 10px; border-radius: 4px; background: color-mix(in srgb, #E9B95A 24%, transparent); font: 600 13.5px/1.4 var(--wum-body, sans-serif); color: var(--wc-ink); }
.wc-c-story svg { flex: none; margin-top: 1px; }
.wc-c-go { display: inline-block; margin-top: 10px; font: 600 14px var(--wum-body, sans-serif); color: #A34A26; text-decoration: none; }
.wc-c-go:hover, .wc-c-go:focus-visible { text-decoration: underline; text-underline-offset: 3px; outline: none; }
.wc-c-go2 { display: table; margin-top: 6px; }
.wc-c-x { position: absolute; top: 8px; right: 9px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--wc-ink); font: 400 22px/1 var(--wum-body, sans-serif); cursor: pointer; }
.wc-c-x:hover, .wc-c-x:focus-visible { background: color-mix(in srgb, var(--wc-ink) 10%, transparent); outline: none; }
/* Step 4b. The picture card (AT-22): a gold-framed card that opens on the place's own picture, the kind of place and
   its name over the picture, the rest beneath. The moment's facts (pop) use the same card. */
.wc-card.wc-card-photo, .wc-card.wc-card-pop { width: 300px; padding: 0; border-radius: 14px; overflow: hidden; border: 3px solid transparent;
  background: linear-gradient(var(--wc-paper), var(--wc-paper)) padding-box, linear-gradient(135deg, #FBE7B0 0%, #C99A4A 18%, #7A5420 38%, #E8C67E 52%, #8A6026 70%, #F6DFA4 86%, #9C6E2C 100%) border-box;
  box-shadow: 0 1px 0 #5E3F18, 0 3px 0 #4A3112, 0 22px 44px -12px rgba(40,24,12,0.6); }
.wc-card.wc-card-photo::before, .wc-card.wc-card-pop::before { display: none; }
.wc-c-hero { position: relative; margin: 0; background: #2A1E16; aspect-ratio: 16 / 9; overflow: hidden; }
.wc-c-hero img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: wcHero 6s ease-out both; }
@keyframes wcHero { to { transform: scale(1); } }
.wc-c-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14,9,6,0.9) 0%, rgba(14,9,6,0.45) 38%, rgba(14,9,6,0) 66%); pointer-events: none; }
.wc-c-over { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 11px; }
.wc-c-over .wc-c-kick { color: #FFD3A8; }
.wc-c-over .wc-c-kick svg { color: #FFD3A8 !important; }
.wc-c-over h4 { margin: 3px 0 0; color: #FFF6EC; font-size: 27px; line-height: 0.98; text-shadow: 0 2px 14px rgba(0,0,0,0.6); }
.wc-c-body { padding: 4px 16px 14px; }
.wc-c-body > :first-child { margin-top: 10px; }
.wc-card-photo .wc-c-big b { color: #A34A26; font-size: 34px; }
.wc-c-body > .wc-c-big:last-child { border-bottom: 0; padding-bottom: 0; }
.wc-sea-name { cursor: pointer; }
.wc-card-photo .wc-c-x, .wc-card-pop .wc-c-x { z-index: 2; color: #FFF6EC; background: rgba(14,9,6,0.45); }
.wc-card-photo .wc-c-x:hover, .wc-card-pop .wc-c-x:hover { background: rgba(14,9,6,0.7); }
.wc-card-pop .wc-c-line { font-size: 14.5px; }
.wc-popmark { pointer-events: none; }
.wc-popring { transform-box: fill-box; transform-origin: center; animation: wcPopRing 1.8s ease-out infinite; }
@keyframes wcPopRing { from { transform: scale(1); opacity: 1; } to { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wc-popring { animation: none; } }
@media (max-width: 700px) {                                     /* on a phone the card rises from the bottom of the screen */
  .wc-card { position: fixed; left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-height: 70vh; overflow-y: auto; z-index: 60; }
  .wc-card.wc-card-pop { position: absolute; left: var(--pl, 8px) !important; top: var(--pt, auto) !important; right: auto; bottom: auto; width: var(--pw, 300px); max-height: none; overflow: hidden; z-index: 5; }
  .wc-card-pop .wc-c-hero { aspect-ratio: 3 / 1; }
  .wc-card-pop .wc-c-over h4 { font-size: 21px; }
  .wc-card-pop .wc-c-body { padding: 0 12px 10px; }
  .wc-card-pop .wc-c-line { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .wc-card-pop .wc-c-go { margin-top: 4px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .wc-card-in, .wc-lights, .wc-sun-halo, .wc-sun-rays, .wc-c-hero img { animation: none; } }

/* Step 5. The two windows, Arcadia City and the visitor's own city, with Earth and Mars round the Sun between them */
.wc-clock { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 220px) minmax(0, 1fr); gap: 12px; }
.wc-live-k { grid-column: 1 / -1; justify-self: center; display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 8px 16px 8px 13px; border-radius: 999px;
  font: 600 11.5px/1 var(--wum-mono, monospace); letter-spacing: .2em; text-transform: uppercase; color: #F4EEE4;
  background: rgba(8, 10, 20, .45); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wc-live-k i { width: 8px; height: 8px; border-radius: 50%; background: #FF5A4E; box-shadow: 0 0 0 0 rgba(255, 90, 78, .6); animation: wcLive 1.8s ease-out infinite; }
.wc-live-k b { color: #FF8A7E; font-weight: 700; }
.wc-live-k span { opacity: .85; }
@keyframes wcLive { 70% { box-shadow: 0 0 0 9px rgba(255, 90, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0); } }
.wc-win { position: relative; min-width: 0; aspect-ratio: 3 / 2; min-height: 262px; border-radius: 14px; overflow: hidden; background: #0B0D16; isolation: isolate;
  border: 2px solid var(--wc-rim, rgba(255,236,220,.4)); color: #FFF8EC;
  box-shadow: 0 0 0 5px rgba(255,255,255,.035), 0 0 44px -2px var(--wc-glow, rgba(224,130,94,.35)), 0 28px 60px -22px rgba(0,0,0,.9); }
.wc-win-mars { --wc-rim: rgba(255,170,120,.78); --wc-glow: rgba(224,110,60,.55); }      /* a warm rim for Mars, a cool one for Earth */
.wc-win-earth { --wc-rim: rgba(150,196,255,.72); --wc-glow: rgba(90,150,255,.5); }
.wc-pics, .wc-pics img, .wc-hud, .wc-veil { position: absolute; inset: 0; width: 100%; height: 100%; }
.wc-pics img { object-fit: cover; object-position: 50% 52%; display: block; opacity: 0; transition: opacity 1.6s ease; }
.wc-pics img:first-child { opacity: 1; }
.wc-win.is-south .wc-pics img { transform: scaleX(-1); }       /* south of the equator you face north: sunrise on the right */
.wc-hud { pointer-events: none; }
.wc-hud [data-k$="Sun"] { transition: opacity 1.2s; }
.wc-veil { pointer-events: none; background: linear-gradient(180deg, rgba(4,6,14,.55) 0%, rgba(4,6,14,0) 34%, rgba(4,6,14,0) 56%, rgba(4,6,14,.72) 100%); }
.wc-sky-tag { font: 700 6.4px var(--wum-mono, monospace); letter-spacing: .14em; text-transform: uppercase; fill: #F6EFE2; fill-opacity: .9; text-anchor: middle; }
.wc-sky-blue { fill: #CFE2FF; } .wc-sky-red { fill: #FFC4A6; }
.wc-top { position: absolute; left: 18px; right: 14px; top: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; text-shadow: 0 1px 16px rgba(0,0,0,.5), 0 0 2px rgba(0,0,0,.4); }
.wc-head { display: grid; gap: 3px; min-width: 0; }
.wc-head b { font: 600 10.5px/1.3 var(--wum-mono, monospace); letter-spacing: .18em; text-transform: uppercase; opacity: .92; }
.wc-time { font: 700 clamp(44px, 5vw, 64px)/0.95 var(--wum-display, sans-serif); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.wc-time small { font-size: .42em; opacity: .7; margin-left: 3px; }
.wc-state { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; text-shadow: none;
  font: 700 11.5px var(--wum-display, sans-serif); letter-spacing: .14em; text-transform: uppercase;
  background: rgba(10,12,22,.32); border: 1px solid rgba(255,255,255,.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wc-state:empty { display: none; }
.wc-state .wc-ic { width: 17px; height: 17px; }
.wc-state[data-s="day"] .wc-ic { color: #FFE08A; } .wc-state[data-s="dawn"] .wc-ic, .wc-state[data-s="dusk"] .wc-ic { color: #FFB577; } .wc-state[data-s="night"] .wc-ic { color: #C9D8FF; }
.wc-head-row { display: flex; align-items: center; gap: 9px; height: 14px; min-width: 0; }     /* one line, so both clocks start at the same height */
.wc-head-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-change { position: relative; flex: none; display: inline-block; font: 600 10.5px/1 var(--wum-body, sans-serif); letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: rgba(10,12,22,.25); text-shadow: none; cursor: pointer; }
.wc-change select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.wc-change:hover, .wc-change:focus-within { background: rgba(255,255,255,.18); }
.wc-head b span { color: #fff; }
.wc-foot { position: absolute; left: 18px; right: 18px; bottom: 13px; display: grid; gap: 5px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.wc-date { margin: 0; font: 600 14px/1.4 var(--wum-body, sans-serif); }
.wc-date [data-wum-tip] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.wc-sunline { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; font: 13px/1.4 var(--wum-body, sans-serif); color: rgba(255,248,236,.88); }
.wc-sunline span { display: inline-flex; align-items: center; gap: 5px; }
.wc-sunline b { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.wc-sunline .wc-ic { width: 16px; height: 16px; color: #FFC98A; }
.wc-next { font-style: italic; }
.wc-mid { height: 0; min-height: 100%; box-sizing: border-box; border-radius: 14px; padding: 13px 14px 11px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #EAE6F2; text-align: center;
  background: radial-gradient(120% 70% at 50% 38%, rgba(28,34,64,.72) 0%, rgba(13,16,34,.74) 60%, rgba(7,9,18,.82) 100%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 2px solid rgba(255,236,220,.42); box-shadow: 0 0 0 5px rgba(255,255,255,.035), 0 0 30px -6px rgba(255,214,150,.25), 0 28px 60px -22px rgba(0,0,0,.9); overflow: hidden; }
.wc-mid-k { font: 600 10px/1.3 var(--wum-mono, monospace); letter-spacing: .18em; text-transform: uppercase; opacity: .8; }
.wc-orbit { width: 100%; max-width: 190px; flex: 1 1 0; min-height: 0; }
.wc-o-t { font: 700 8.5px var(--wum-mono, monospace); letter-spacing: .1em; text-transform: uppercase; fill: #F4E7C7; text-anchor: middle; }
.wc-o-e { fill: #B9D4FF; } .wc-o-m { fill: #F6B08E; }
.wc-gapline { margin: 0; font: 700 13.5px var(--wum-body, sans-serif); color: #fff; }
.wc-mid-row { display: grid; gap: 0; width: 100%; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.12); font: 12.5px/1.35 var(--wum-body, sans-serif); }
.wc-mid-row b { font: 600 9.5px/1.3 var(--wum-mono, monospace); letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.wc-mid-row b[data-wum-tip] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.wc-mid-row span { font-weight: 600; color: #FFD9A8; }
@media (max-width: 860px) {                                    /* on a phone: Mars, then the Solar System as a strip, then Earth */
  .wc-clock { grid-template-columns: 1fr; } .wc-head b { letter-spacing: .1em; } .wc-top { left: 14px; right: 12px; } .wc-win { aspect-ratio: 16 / 11; min-height: 250px; }
  .wc-mid { height: auto; min-height: 0; display: grid; grid-template-columns: 132px 1fr; grid-template-areas: "k k" "o g" "o w" "o d"; align-items: center; text-align: left; column-gap: 14px; row-gap: 4px; }
  .wc-mid-k { grid-area: k; text-align: center; } .wc-orbit { grid-area: o; max-width: 132px; height: 132px; flex: none; } .wc-gapline { grid-area: g; }
  .wc-mid-row:nth-of-type(1) { grid-area: w; } .wc-mid-row:nth-of-type(2) { grid-area: d; }
}
@media (prefers-reduced-motion: reduce) { .wc-pics img, .wc-hud [data-k$="Sun"] { transition: none; } .wc-live-k i { animation: none; } }

/* Map modes (05-13 numbers.modes): the moments step aside and a page draws its own layer over the chart */
.wc-lens .wc-moment, .wc-lens .wc-live, .wc-lens .wc-night, .wc-lens .wc-relief, .wc-lens .wc-ribbon, .wc-lens .wc-hint { display: none; }
.wc-lens .wc-place, .wc-lens .wc-place.wc-under { opacity: 0.42; pointer-events: auto; }
.wc-over [data-lid] { cursor: pointer; }
.wc-over [data-lid]:focus { outline: none; }

/* The countdown over the city to its next sunset (blue) or sunrise (gold), ticking in Mars seconds (chart.js Step 5c e) */
.wc-count { pointer-events: none; }
.wc-count-box { fill: #16202E; fill-opacity: 0.92; stroke: #5FA8FF; stroke-width: 0.7; }
.wc-count-word { fill: #BFDDFF; }
.wc-count-time { fill: #FFFFFF; font-variant-numeric: tabular-nums; }
.wc-count-dot { fill: #5FA8FF; transform-box: fill-box; transform-origin: center; animation: wcLiveDot 1.6s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .wc-count-dot { animation: none; } }
.wc-count[data-kind="rise"] .wc-count-box { fill: #2B1A10; stroke: #F6B73C; }
.wc-count[data-kind="rise"] .wc-count-word { fill: #FFD98A; }
.wc-count[data-kind="rise"] .wc-count-dot { fill: #F6B73C; }
.wc-lens .wc-count { display: none; }

/* Step 6. The living atlas (05-13 AT-24, AT-25) */
/* a. The corner, over the chart's top right: the Live badge (its red light beats once every Mars second, --wc-beat),
      Spin a day and the lens. On a phone it sits at the top right of the part of Mars in view. */
.wc-stage { position: relative; }
.wc-corner { position: absolute; z-index: 4; top: calc(26 / 412 * 100% + 7px); right: calc(30 / 780 * 100% + 7px); display: flex; align-items: center; gap: 6px; pointer-events: none; }
.wc-corner > * { pointer-events: auto; }
@media (max-width: 700px) { .wc-corner { right: 8px; } }
.wc-badge, .wc-spin, .wc-lensbtn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--wc-ink) 30%, transparent); background: rgba(247, 239, 222, 0.93); color: var(--wc-ink);
  box-shadow: 0 2px 10px rgba(59, 46, 34, 0.22); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  font: 700 11px/1 var(--wum-display, sans-serif); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; transition: background 0.2s, transform 0.2s; }
.wc-badge[hidden], .wc-spin[hidden] { display: none; }
.wc-badge:hover, .wc-spin:hover, .wc-lensbtn:hover, .wc-badge:focus-visible, .wc-spin:focus-visible, .wc-lensbtn:focus-visible { background: #FFF8EA; transform: translateY(-1px); outline: none; }
.wc-spin svg, .wc-lensbtn svg, .wc-badge svg { width: 14px; height: 14px; flex: none; }
.wc-spin:disabled { cursor: default; opacity: 0.55; transform: none; }
.wc-lensbtn[aria-pressed="true"] { background: var(--wc-ink); color: var(--wc-paper); }
.wc-badge[data-state="live"] { color: #D21F12; font-weight: 800; font-size: 12px; letter-spacing: 0.2em; padding-right: 11px; }
.wc-b-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #FF2A1C; animation: wcBeat var(--wc-beat, 1028ms) ease-out infinite; }
@keyframes wcBeat { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 42, 28, 0.65); } 14% { transform: scale(1.3); } 32% { transform: scale(1); } 100% { box-shadow: 0 0 0 8px rgba(255, 42, 28, 0); } }
.wc-badge[data-state="then"] { padding-right: 4px; letter-spacing: 0.08em; }
.wc-badge[data-state="then"] em { display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; height: 20px; padding: 0 9px 0 8px; border-radius: 999px; font-style: normal; color: #FFF6EE; background: #C2281A; letter-spacing: 0.1em; }
.wc-badge[data-state="then"] em .wc-b-dot { width: 6px; height: 6px; background: #FFE3DD; }
.wc-badge[data-state="spin"] { color: #8A5A10; }
.wc-badge[data-state="spin"] .wc-b-dot { background: #F6B73C; animation-duration: 0.5s; }
.wc-badge span { font: 700 11px var(--wum-mono, monospace); letter-spacing: 0.04em; text-transform: none; font-variant-numeric: tabular-nums; opacity: 0.85; }
@media (max-width: 700px) { .wc-spin span, .wc-lensbtn span { display: none; } .wc-spin, .wc-lensbtn { padding: 0 7px; } }
.wc-lens .wc-badge, .wc-lens .wc-spin, .wc-lens .wc-seasons { display: none; }
/* b. On the live layer: the Sun's way, frost, haze, the moons gliding and Phobos's shadow */
.wc-sun-dir { pointer-events: auto; }
.wc-sun-dir path { animation: wcDir 1.8s ease-in-out infinite; opacity: 0.2; }
@keyframes wcDir { 0%, 100% { opacity: 0.15; } 40% { opacity: 0.95; } }
.wc-frost, .wc-hazes, .wc-pshadow { pointer-events: none; }
.wc-crystal { transform-box: fill-box; transform-origin: center; animation: wcGlint 5s ease-in-out infinite; opacity: 0.35; }
@keyframes wcGlint { 0%, 70%, 100% { opacity: 0.3; transform: scale(0.8); } 82% { opacity: 1; transform: scale(1.35) rotate(30deg); } }
.wc-haze { transform-box: fill-box; transform-origin: center; animation: wcHazeDrift 24s linear infinite; opacity: 0; }
@keyframes wcHazeDrift { 0% { opacity: 0; transform: translate(-12px, 0) scale(0.9); } 20% { opacity: 1; } 80% { opacity: 0.9; } 100% { opacity: 0; transform: translate(64px, 5px) scale(1.25); } }
.wc-moon, .wc-pshadow { transition: transform 3s linear; }
/* c. Inked routes and wax seals */
.wc-ink-in { stroke-dashoffset: 1; animation: wcInk 1.2s cubic-bezier(.5, 0, .3, 1) forwards; }
.wc-ink-late { opacity: 0; animation: wcFade 0.5s 1.1s ease forwards; }
.wc-nib { pointer-events: none; animation: wcNib 1.6s ease forwards; }
@keyframes wcNib { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
.wc-seal { pointer-events: none; }
.wc-seal-in { transform-box: fill-box; transform-origin: center; animation: wcSeal 2.8s cubic-bezier(.2, .8, .2, 1) both; filter: drop-shadow(0 1.5px 1px rgba(60, 14, 6, 0.45)); }
.wc-seal-late .wc-seal-in { animation-delay: 0.75s; }
@keyframes wcSeal { 0% { opacity: 0; transform: scale(2); } 16% { opacity: 1; transform: scale(0.9); } 24% { transform: scale(1.04); } 30% { transform: scale(1); } 68% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
/* d. The impact replays */
.wc-fx { pointer-events: none; transition: opacity 1.4s ease; }
.wc-fx.wc-fx-out { opacity: 0; }
.wc-shake { animation: wcShake 0.45s cubic-bezier(.36, .07, .19, .97); }
@keyframes wcShake { 15% { transform: translate(-2px, 1px); } 30% { transform: translate(2px, -1px); } 45% { transform: translate(-1.5px, -1px); } 60% { transform: translate(1px, 1px); } 80% { transform: translate(-0.5px, 0); } }
.wc-c-again { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, #A34A26 45%, transparent); background: color-mix(in srgb, #A34A26 9%, transparent); color: #A34A26; font: 600 13px var(--wum-body, sans-serif); }
.wc-c-again svg { width: 15px; height: 15px; }
.wc-c-again:hover, .wc-c-again:focus-visible { background: #A34A26; color: #FFF6EE; outline: none; }
/* e. The brass lens: the real Mars under the glass, a brass rim, a glint, a handle and a caption under it */
.wc-glass { position: absolute; left: 0; top: 0; z-index: 4; width: var(--lp, 200px); height: var(--lp, 200px); pointer-events: none; will-change: transform;
  filter: drop-shadow(0 18px 22px rgba(30, 18, 8, 0.5)); transition: opacity 0.25s; }
.wc-glass[hidden] { display: none; }
.wc-glass.away { opacity: 0; }
.wc-glass-touch { pointer-events: auto; touch-action: none; cursor: grab; }
.wc-glass-pic { position: absolute; inset: 0; border-radius: 50%; background: #2A1B12 no-repeat; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45), inset 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 -6px 18px rgba(255, 200, 140, 0.12); }
.wc-glass::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; padding: 12px;
  background: conic-gradient(from 200deg, #FBE7B0, #C99A4A, #7A5420, #E8C67E, #8A6026, #F6DFA4, #9C6E2C, #FBE7B0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.wc-glass::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 34%), radial-gradient(circle at 72% 80%, rgba(255, 226, 180, 0.14), rgba(255, 226, 180, 0) 40%); }
.wc-glass-dot { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: rgba(255, 246, 228, 0.85); box-shadow: 0 0 0 1px rgba(40, 24, 12, 0.6); }
.wc-glass-handle { position: absolute; left: calc(50% + 0.64 * var(--lp, 200px) * 0.5); top: calc(50% + 0.64 * var(--lp, 200px) * 0.5); width: 74px; height: 15px; border-radius: 4px 8px 8px 4px;
  transform: rotate(45deg); transform-origin: 0 50%; background: linear-gradient(180deg, #E8C67E, #8A6026 55%, #5E3F18); box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.7); }
.wc-glass-cap { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 18px); white-space: nowrap; padding: 4px 10px; border-radius: 999px;
  font: italic 600 11.5px/1 var(--wum-body, sans-serif); color: var(--wc-ink); background: rgba(247, 239, 222, 0.94); box-shadow: 0 2px 8px rgba(59, 46, 34, 0.2); }
@media (pointer: fine) { .wc-lensing .wc-sheet { cursor: none; } }
@media (prefers-reduced-motion: reduce) {
  .wc-b-dot, .wc-sun-dir path, .wc-crystal, .wc-haze, .wc-nib, .wc-seal-in, .wc-shake { animation: none; }
  .wc-sun-dir path { opacity: 0.7; } .wc-haze { opacity: 0.8; } .wc-seal { display: none; } .wc-moon, .wc-pshadow { transition: none; }
}

