/* World map, the traveller's layer: passport of a place, climate, scale ramp, minimap, the road between two places,
   beacons of campaigns and heroes, the «Сейчас в мире» list. Scripts: map-explore.js, map-players.js, map-route.js.
   Motion only under prefers-reduced-motion: no-preference and only transform and opacity. */

/* ─── dossier: header and passport ─── */
.phead{display:block}
.pass{display:grid;grid-template-columns:1fr 1fr;gap:1px;margin-top:14px;border:1px solid var(--hair-2);border-radius:4px;overflow:hidden;background:var(--hair-2)}
.pc{display:flex;flex-direction:column;gap:2px;min-width:0;padding:9px 12px 10px;background:var(--ink)}
.pc .cap{font-size:13px;color:var(--faint)}
.pc b{font-weight:500;font-size:15px;line-height:1.25;color:var(--paper)}
.pc small{font-size:12.5px;line-height:1.35;color:var(--muted)}
.pc[class*=" s-"]{grid-column:1/-1;box-shadow:inset 3px 0 0 var(--st)}
.pc[class*=" s-"] b{color:var(--st)}
.pc.s-1{--st:#9CBF86}.pc.s-2{--st:#D6AE4E}.pc.s-3{--st:#D08055}.pc.s-4{--st:#E0714A}
.pc:only-child,.pc[class*=" s-"]+.pc:last-child{grid-column:1/-1}
.pc.cl[style] b::before{content:"";display:inline-block;width:9px;height:9px;margin-right:7px;border-radius:2px;background:var(--c);box-shadow:0 0 0 1px rgba(0,0,0,.35)}
/* phones: the name and the passport come first, the picture after them */
@media(max-width:820px),(max-height:500px){
  #pbody{display:flex;flex-direction:column}
  #pbody>.phead{order:-1}
  #pbody>.bsrc{align-self:flex-start}
  #panel .hero,#panel .hero-ph{margin:14px 0 2px}
  #panel h2{font-size:26px}
}

/* «who is your hero» prompt in a dossier */
button.rel.ask{display:flex;flex-direction:column;gap:2px;width:100%;min-height:44px;text-align:left;font:inherit;font-size:13.5px;line-height:1.45;
  border-left-color:var(--light);cursor:pointer;transition:border-color .2s var(--ease)}
button.rel.ask b{color:var(--light)}
button.rel.ask:hover{border-color:var(--light)}

/* ─── layers: climate fill, short ramp on the map, full list in «знаки» ─── */
[data-climate="1"] .reg .fill{fill:var(--cl,transparent);opacity:.42}
.scale{cursor:pointer}
.scale .ramp{gap:3px}
.scale .ramp em{font-style:normal;color:var(--muted)}
.scale .ramp em:first-child{margin-right:4px}
.scale .ramp em:last-child{margin-left:4px}
.scale .ramp .sw{width:16px;height:10px;border-radius:1px}
.sw.bl{background:repeating-linear-gradient(45deg,rgba(176,96,58,.9) 0 2px,transparent 2px 5px);border-color:#8A3D22}
.legend #leg-layer{display:block;padding:0}
.legend #leg-layer:empty{display:none}
@media(max-width:820px),(max-height:500px){.scale{max-width:calc(100vw - 148px)}}

/* ─── minimap ─── */
#mini{position:fixed;top:112px;right:18px;z-index:44;width:168px;aspect-ratio:16/9;border:1px solid rgba(90,52,24,.8);border-radius:3px;overflow:hidden;
  background:#2A2318;box-shadow:0 0 0 1px rgba(250,241,220,.55),0 6px 18px rgba(0,0,0,.4);touch-action:none;cursor:pointer;user-select:none;-webkit-user-select:none;
  opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s var(--ease),visibility 0s .3s}
#mini.on{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .3s var(--ease)}
#mini img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-drag:none}
#mini i{position:absolute;left:0;top:0;border:1.5px solid #FFF6E4;border-radius:1px;background:rgba(185,208,234,.22);box-shadow:0 0 0 1px rgba(42,21,8,.75);pointer-events:none;will-change:transform}
body.sheet #mini{right:410px}
@media(max-width:820px),(max-height:500px){
  #mini{top:106px;right:12px;width:112px}
  body.sheet #mini{right:12px}
}
@media(max-height:500px) and (orientation:landscape){body.sheet #mini{right:calc(min(45vw,392px) + 12px)}}

/* ─── paths from a place ─── */
.trv-list{display:grid;margin-top:4px}
.trv-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:0;background:none;border:none;border-bottom:1px solid var(--hair);
  color:var(--paper);font:inherit;font-size:14.5px;text-align:left;cursor:pointer}
.trv-row b{font-weight:400;min-width:0}
.trv-row span{flex:none;font-family:var(--mono);font-size:14px;letter-spacing:.05em;color:var(--muted)}
.trv-row:hover b,.trv-row:focus-visible b{color:var(--light)}
.trv-note{margin-top:8px;font-size:12.5px;line-height:1.45;color:var(--faint)}
.trv-go{margin-top:12px;min-height:44px;padding:0 18px;border:1px solid var(--volt,#5CE1F0);border-radius:999px;background:none;color:var(--volt,#5CE1F0);
  font-family:var(--mono);font-size:14px;letter-spacing:.05em;cursor:pointer;transition:background-color .2s var(--ease)}
.trv-go:hover{background:rgba(92,225,240,.12)}

/* ─── route bar ─── */
/* wide screens: a card in the top left corner, where the colour ramp was; phones: a strip across the top */
#rbar{position:fixed;top:112px;left:max(28px,calc((100vw - 1240px)/2 + 28px));z-index:46;display:none;grid-template-columns:1fr auto auto;align-items:start;gap:8px 4px;width:400px;
  padding:12px 8px 12px 16px;background:var(--panel);border:1px solid var(--hair-2);border-radius:4px;box-shadow:0 14px 34px rgba(0,0,0,.45)}
#rbar.on{display:grid}
.rb-main{grid-area:1/1;display:flex;flex-direction:column;gap:1px;min-width:0;padding-top:2px}
.rb-main b{font-family:var(--disp);font-weight:400;font-size:19px;line-height:1.2;color:var(--paper)}
.rb-swap,.rb-x{width:44px;height:44px;margin:-6px 0;display:grid;place-items:center;background:none;border:none;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}
.rb-swap{grid-area:1/2}.rb-x{grid-area:1/3}
.rb-swap svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.rb-swap:hover,.rb-x:hover{color:var(--light)}
.rb-days{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:1px;margin-right:8px;border:1px solid var(--hair-2);border-radius:4px;overflow:hidden;background:var(--hair-2)}
.rb-days span{display:flex;flex-direction:column;gap:1px;padding:7px 10px 8px;background:var(--ink);font-family:var(--mono);font-size:13px;letter-spacing:.05em;color:var(--faint)}
.rb-days b{font-family:var(--sans);font-weight:500;font-size:15.5px;letter-spacing:0;color:var(--paper);white-space:nowrap}
.rb-days span:first-child b{color:var(--light)}
.rb-note{grid-column:1/-1;margin-right:8px;font-size:13px;line-height:1.45;color:var(--muted)}
.rb-note:empty{display:none}
.rb-note.s-3,.rb-note.s-4{padding-left:9px;box-shadow:inset 2px 0 0 #D08055}
.rb-note.s-4{box-shadow:inset 2px 0 0 #E0714A}
@media(max-width:820px),(max-height:500px){
  #rbar{top:106px;left:12px;right:12px;width:auto;padding:10px 6px 10px 14px}
  .rb-main b{font-size:17px}
}
/* landscape phone: the stage is low, the card keeps to the corner above the zoom buttons and drops its note */
@media(max-height:500px) and (orientation:landscape){
  #rbar{top:104px;right:auto;width:292px;gap:4px;padding:6px 4px 8px 12px}
  .rb-main b{font-size:15.5px}
  .rb-days span{padding:4px 8px 5px;font-size:12px}
  .rb-days b{font-size:14px}
  .rb-note{display:none}
}
/* while a route is on the screen the ramp gives it the room */
body.routing .scale{display:none}
body.routing #stage{cursor:crosshair}

/* ─── the route on the map (svg, map units; --rz keeps the line the same width on the screen) ─── */
.rt{pointer-events:none;--rz:1}
.rt path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.rt-case{stroke:rgba(251,242,220,.92);stroke-width:calc(7px*var(--rz))}
.rt-line{stroke:#8A2414;stroke-width:calc(3.2px*var(--rz))}
.rt-wild{stroke-dasharray:calc(.1px*var(--rz)) calc(7px*var(--rz))}
.rt-sea{stroke:#1D5671;stroke-dasharray:calc(9px*var(--rz)) calc(7px*var(--rz))}
.rt-reveal{stroke:#fff;stroke-width:calc(40px*var(--rz));stroke-dasharray:1;stroke-dashoffset:0}
.rt-end{fill:#8A2414;stroke:#FBF2DC;stroke-width:calc(2px*var(--rz));r:calc(5px*var(--rz))}
.rt-ring{fill:none;stroke:#8A2414;stroke-width:calc(2px*var(--rz));r:calc(10px*var(--rz));opacity:.85}

/* ─── beacons: a light at the exact point of a campaign or a hero ─── */
/* drawn under the names: the ring goes round the seal of the place and never covers its glyph */
#labels .l.mp-beacon{width:0;height:0;z-index:2;pointer-events:none}
.mp-beacon i{position:absolute;left:-15px;top:-15px;width:30px;height:30px;border-radius:50%;border:2px solid var(--light,#B9D0EA);
  background:radial-gradient(rgba(185,208,234,.5),rgba(185,208,234,0) 68%);box-shadow:0 0 0 1px rgba(17,25,37,.6),0 0 12px 2px rgba(185,208,234,.6)}
.mp-beacon.camp i{left:-17px;top:-17px;width:34px;height:34px;border-color:var(--ember,#E07A3A);background:radial-gradient(rgba(224,122,58,.6),rgba(224,122,58,0) 68%);
  box-shadow:0 0 0 1px rgba(40,18,6,.6),0 0 14px 3px rgba(224,122,58,.7)}
.mp-beacon.camp i+i{left:-30px;top:-30px;width:60px;height:60px;background:none;box-shadow:none;opacity:0}
.l.mp-mark.camp{border-color:var(--ember,#E07A3A);background:rgba(34,18,8,.92)}
/* thread from a place to its marker pushed aside, set by lights() in map-labels.js; --bk sizes the ring to the seal */
#labels .l.mp-beacon::before{content:"";position:absolute;left:0;top:0;width:var(--tl,0px);height:2px;margin-top:-1px;border-radius:1px;
  transform-origin:0 50%;transform:translate(var(--tx,0px),var(--ty,0px)) rotate(var(--ta,0rad));background:var(--light,#B9D0EA);box-shadow:0 0 0 1px rgba(17,25,37,.6)}
#labels .l.mp-beacon.camp::before{background:var(--ember,#E07A3A)}
.mp-beacon i{transform:scale(var(--bk,1))}

/* status dot: live campaign, open call, announced, finished */
.dot{position:relative;flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--faint)}
.dot.live{background:var(--ember,#E07A3A)}
.dot.rec{background:var(--volt,#5CE1F0)}
.dot.soon{background:none;box-shadow:inset 0 0 0 1.5px var(--light,#B9D0EA)}
.dot.live::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1.5px solid var(--ember,#E07A3A);opacity:0}

/* ─── «Сейчас в мире» ─── */
#mnow .dot{margin-right:1px}
.mp-pop.mp-now{width:min(340px,calc(100vw - 24px));padding-bottom:4px}
.mn-scroll{max-height:min(54svh,440px);overflow-y:auto;overscroll-behavior:contain;margin:0 -6px;padding:0 6px}
.mn-scroll h3.cap{display:block;font-weight:400;font-size:13px;color:var(--faint);margin:10px 0 2px}
.mn-scroll h3.cap:first-child{margin-top:0}
.mn-row{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:5px 0;background:none;border:none;color:var(--paper);font:inherit;text-align:left;text-decoration:none;cursor:pointer}
.mn-row>span:last-child{display:grid;min-width:0;line-height:1.3}
.mn-row b{font-weight:500;font-size:14.5px}
.mn-row small{font-size:12.5px;color:var(--muted)}
.mn-row:hover b,.mn-row:focus-visible b{color:var(--light)}
.mn-row>.dot{margin:0 4px}
.mn-row .faces{flex:none;display:inline-flex}
.mn-row .faces img,.mn-row .faces i{width:24px;height:24px;border-radius:50%;object-fit:cover;object-position:50% 20%;border:1.5px solid var(--light,#B9D0EA);background:#2A2016;margin-left:-8px;
  display:grid;place-items:center;font-style:normal;font-family:var(--disp);font-size:12px;color:#F1E3C6}
.mn-row .faces :first-child{margin-left:0}
.mp-now a.mp-more{display:flex;align-items:center;text-decoration:none}
.mn-off{margin-top:6px;border-top:1px solid var(--hair-2)}
.mn-off summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;cursor:pointer;list-style:none}
.mn-off summary::-webkit-details-marker{display:none}
.mn-off summary::after{content:"+";color:var(--muted)}
.mn-off[open] summary::after{content:"\2212"}
.mp-camp .cap{display:inline-flex;align-items:center;gap:8px;font-size:13px}
.mp-camp.live{border-color:rgba(224,122,58,.7);background:rgba(224,122,58,.1)}
.mp-camp.live .cap{color:var(--ember-hi,#F0A060)}
.mp-camp:not(.live){border-color:var(--hair-2);background:var(--ink)}

/* ─── motion ─── */
@media(prefers-reduced-motion:no-preference){
  .mp-beacon.camp i+i{animation:mp-light 2.6s cubic-bezier(.2,.6,.3,1) infinite}
  @keyframes mp-light{0%{transform:scale(calc(.3*var(--bk,1)));opacity:.9}70%,100%{transform:scale(var(--bk,1));opacity:0}}
  .dot.live::after{animation:mp-ring 2.6s cubic-bezier(.2,.6,.3,1) infinite}
  @keyframes mp-ring{0%{transform:scale(.25);opacity:.9}70%,100%{transform:scale(1);opacity:0}}
  #rbar.on{animation:rb-in .35s var(--ease)}
  @keyframes rb-in{from{opacity:0;transform:translateY(-8px)}}
  .rt-reveal{animation:rt-draw 1.1s cubic-bezier(.5,0,.2,1) both}
  @keyframes rt-draw{from{stroke-dashoffset:1}}
  .rt-ring{transform-box:fill-box;transform-origin:center;animation:rt-ping 1.4s .9s cubic-bezier(.2,.6,.3,1) 2 both}
  @keyframes rt-ping{from{transform:scale(.4);opacity:1}to{transform:scale(1.5);opacity:0}}
  .pass,.trv{animation:pc-in .4s var(--ease) both}
  @keyframes pc-in{from{opacity:0;transform:translateY(6px)}}
}
