/* «Разъезд» — the board. Everything is scoped to .rails and prefixed rl- so it can sit inside any host page
   (the standalone shell, Nalogopolis) without touching its styles. A skin is a set of --rl-* variables:
   <div class="rails" data-skin="night">. The host gives .rails its size; the board keeps its proportions inside. */
.rails{
  --rl-field:#ECE2CF; --rl-rail:#A0A5A4; --rl-rail-d:#4E5556; --rl-rail-hi:rgba(255,255,255,.88); --rl-sleeper:#BFA174; --rl-sleeper-d:#846241; --rl-dot:#D3C6AC;
  --rl-blue:#A8C7E3; --rl-blue-d:#7BA2C7; --rl-mint:#A6DAC3; --rl-mint-d:#6FB295; --rl-rose:#E3B4BC; --rl-rose-d:#C48A95;
  --rl-sand:#E7CF9B; --rl-sand-d:#BF9D58;
  --rl-bump:#E5917F; --rl-shadow:rgba(84,60,30,.26); --rl-glass:rgba(255,255,255,.62); --rl-roof:rgba(255,255,255,.32);
  --rl-lamp:#FFF8E6; --rl-focus:#38342F; --rl-radius:20px; --rl-deck:#E6D8BD;
  background:var(--rl-field); border-radius:var(--rl-radius); position:relative;
  -webkit-tap-highlight-color:transparent; user-select:none; -webkit-user-select:none;
}
.rails[data-skin="dawn"]{
  --rl-field:#F4DFCF; --rl-rail:#8C7D77; --rl-rail-d:#6F605A; --rl-rail-hi:rgba(255,255,255,.68); --rl-sleeper:#D8B9A4; --rl-sleeper-d:#B69682; --rl-dot:#E1C3AF;
  --rl-blue:#C5BCE6; --rl-blue-d:#9C8FCF; --rl-mint:#B8DEB9; --rl-mint-d:#80B887; --rl-rose:#F2B3A3; --rl-rose-d:#D68672;
  --rl-shadow:rgba(110,60,40,.24); --rl-deck:#FCEFE5;
}
.rails[data-skin="winter"]{
  --rl-field:#E3EBF1; --rl-rail:#7D8A96; --rl-rail-d:#65717C; --rl-rail-hi:rgba(255,255,255,.7); --rl-sleeper:#BDCBD6; --rl-sleeper-d:#9AAAB7; --rl-dot:#C7D2DB;
  --rl-blue:#AAC4E9; --rl-blue-d:#7096CC; --rl-mint:#AAD3B7; --rl-mint-d:#6FA785; --rl-rose:#E8A6A6; --rl-rose-d:#C77373;
  --rl-shadow:rgba(40,60,90,.24); --rl-focus:#2E3A46; --rl-deck:#F5F8FB;
}
.rails[data-skin="forest"]{
  --rl-field:#DDE5D0; --rl-rail:#747B6C; --rl-rail-d:#5E6457; --rl-rail-hi:rgba(255,255,255,.65); --rl-sleeper:#BDA987; --rl-sleeper-d:#9A896B; --rl-dot:#C6CFB5;
  --rl-blue:#AACAD9; --rl-blue-d:#729DB1; --rl-mint:#E7CB90; --rl-mint-d:#C39F55; --rl-rose:#E5B0A3; --rl-rose-d:#C57F6E;
  --rl-shadow:rgba(50,60,30,.26); --rl-focus:#33392C; --rl-deck:#EFF3E8;
}
.rails[data-skin="night"]{
  --rl-field:#2F3542; --rl-rail:#99A3B6; --rl-rail-d:#BCC4D2; --rl-rail-hi:rgba(255,255,255,.55); --rl-sleeper:#454E60; --rl-sleeper-d:#343B4A; --rl-dot:#454E60;
  --rl-blue:#8FC3D3; --rl-blue-d:#5E9DB1; --rl-mint:#A9C592; --rl-mint-d:#7E9D68; --rl-rose:#E5A9B9; --rl-rose-d:#C27E93;
  --rl-sand:#E2C88E; --rl-sand-d:#B89A55;
  --rl-shadow:rgba(0,0,0,.45); --rl-glass:rgba(255,255,255,.55); --rl-roof:rgba(255,255,255,.22); --rl-lamp:#FFE9A8; --rl-focus:#F2F4F8;
  --rl-deck:#414A5C;
}
/* fill / stroke reset: a host's own svg rules (icon styles and the like) must not leak onto the board */
.rl-board{display:block; width:100%; height:100%; touch-action:none; overflow:hidden; fill:none; stroke:none}
.rl-fade-0{stop-color:var(--rl-field); stop-opacity:1}
.rl-fade-1{stop-color:var(--rl-field); stop-opacity:0}
.rl-sleeper-sh{fill:var(--rl-sleeper-d); opacity:.52}
.rl-sleeper{fill:var(--rl-sleeper); stroke:var(--rl-sleeper-d); stroke-width:1.1}
.rl-sleeper-grain{stroke:rgba(101,72,41,.62); stroke-width:1.05; stroke-linecap:round; opacity:.78}
.rl-sleeper-grain-hi{stroke:rgba(245,222,184,.9); stroke-width:.8; stroke-linecap:round; opacity:.78}
.rl-rail-bed{fill:none; stroke:var(--rl-rail-d); stroke-width:7.2; stroke-linecap:butt; stroke-linejoin:round}
.rl-rail{fill:none; stroke:var(--rl-rail); stroke-width:4.2; stroke-linecap:butt; stroke-linejoin:round}
.rl-rail-glint{fill:none; stroke:var(--rl-rail-hi); stroke-width:1.15; stroke-linecap:butt; opacity:.88}
.rl-rail-glint-soft{opacity:.42}.rl-rail-bed.rl-bridge{stroke-width:2.8; vector-effect:non-scaling-stroke}
.rl-rail.rl-bridge{stroke-width:1.8; vector-effect:non-scaling-stroke}
.rl-rail-glint.rl-bridge{stroke-width:.7; opacity:.95; vector-effect:non-scaling-stroke}
.rl-rail-glint-soft.rl-bridge{opacity:.42}
.rl-bridge-sleeper-sh{opacity:.65}
.rl-bridge-sleeper{fill:var(--rl-sleeper); stroke:var(--rl-sleeper-d); stroke-width:1.2; vector-effect:non-scaling-stroke}
.rl-bridge-grain{stroke:rgba(255,255,255,.68); stroke-width:1.2; opacity:.8}
.rl-alt{opacity:.3}
.rl-sw-off{opacity:.5}
.rl-swmark{fill:none; stroke:var(--rl-rail-d); stroke-width:4; stroke-linecap:round; stroke-linejoin:round}
.rl-dot{fill:var(--rl-dot)}
.rl-sh{fill:var(--rl-shadow)}
.rl-sh-soft{opacity:.45}
.rl-glass{fill:var(--rl-glass); stroke:rgba(255,255,255,.7); stroke-width:1.2}
.rl-window-split{stroke:rgba(67,77,84,.28); stroke-width:1.3}
.rl-roof{fill:var(--rl-roof)}
.rl-cab{stroke:rgba(55,64,70,.18); stroke-width:1.5}
.rl-loco-bonnet{stroke:rgba(255,255,255,.48); stroke-width:1.2}
.rl-vent{fill:rgba(65,75,80,.14); stroke:rgba(255,255,255,.48); stroke-width:1}
.rl-panel-line{stroke:rgba(255,255,255,.62); stroke-width:1.2; stroke-linecap:round}
.rl-lamp{fill:var(--rl-lamp)}
.rl-lamp-halo{fill:var(--rl-lamp); opacity:.3}
.rl-bumper{stroke:var(--rl-rail-d); stroke-width:3; stroke-linecap:round}
.rl-car-inset{fill:none; stroke:rgba(255,255,255,.52); stroke-width:1.25}
.rl-car-highlight{stroke:rgba(255,255,255,.62); stroke-width:1.2; stroke-linecap:round}
.rl-bogie{fill:rgba(66,73,78,.2); stroke:rgba(255,255,255,.38); stroke-width:.8}
.rl-bogie-hub{fill:rgba(255,255,255,.72)}
.rl-chassis{fill:rgba(57,62,63,.18); stroke:rgba(57,62,63,.2); stroke-width:1}
.rl-coupler{stroke:var(--rl-rail-d); stroke-width:7; stroke-linecap:round}
.rl-stop{fill:var(--rl-bump); stroke:var(--rl-rail-d); stroke-width:2}
.rl-stop-post{fill:var(--rl-rail-d)}
.rl-deck{fill:var(--rl-deck); stroke:none}
.rl-ramp{fill:var(--rl-deck); opacity:.9; stroke:rgba(132,98,65,.18); stroke-width:1}
.rl-deck-sh{fill:var(--rl-shadow); opacity:.32}
.rl-bridge-pier-sh{fill:var(--rl-shadow); opacity:.7}
.rl-bridge-pier{fill:#A88351; stroke:#6E4D2A; stroke-width:1.6}
.rl-portal{fill:var(--rl-rail-d); opacity:.7}
.rl-parapet{stroke:#755536; stroke-width:2.8; stroke-linecap:round; vector-effect:non-scaling-stroke}
.rl-parapet-hi{stroke:rgba(246,225,191,.92); stroke-width:1; stroke-linecap:round; vector-effect:non-scaling-stroke}
.rl-bridge-fence-post{fill:#B89361; stroke:#755536; stroke-width:1.2; vector-effect:non-scaling-stroke}
.rails[data-skin="night"] .rl-bridge-sleeper{fill:#606B7E; stroke:#343B4A}
.rl-c-blue{fill:var(--rl-blue)} .rl-d-blue{fill:var(--rl-blue-d); stroke:var(--rl-blue-d)}
.rl-c-mint{fill:var(--rl-mint)} .rl-d-mint{fill:var(--rl-mint-d); stroke:var(--rl-mint-d)}
.rl-c-rose{fill:var(--rl-rose)} .rl-d-rose{fill:var(--rl-rose-d); stroke:var(--rl-rose-d)}
.rl-c-sand{fill:var(--rl-sand)} .rl-d-sand{fill:var(--rl-sand-d); stroke:var(--rl-sand-d)}
.rl-train{cursor:pointer; outline:none}
.rl-hit{fill:transparent; pointer-events:all}
.rl-lift,.rl-shk,.rl-sh{transform-box:fill-box; transform-origin:center}
.rl-lift,.rl-sh{transition:transform .16s ease}
.rl-train.rl-hot .rl-lift{transform:scale(1.05)}
.rl-car-shadow.rl-hot .rl-sh{transform:scale(1.12)}
.rl-train:focus-visible .rl-body{stroke:var(--rl-focus); stroke-width:3}
.rl-train.rl-hinted .rl-loco .rl-lift{animation:rl-pulse .85s ease-in-out infinite; filter:drop-shadow(0 0 4px rgba(255,255,255,.95))}
.rl-train.rl-hinted .rl-loco .rl-body{stroke:#FFB000 !important;stroke-width:3.5;stroke-linejoin:round;paint-order:stroke fill;vector-effect:non-scaling-stroke}
.rl-train.rl-hinted .rl-loco{filter:drop-shadow(0 0 3px rgba(255,176,0,.8))}
/* a train that bumped once waits for its way with its lamp blinking */
.rl-train.rl-waiting .rl-lamp{fill:var(--rl-bump); animation:rl-blink 1.1s ease-in-out infinite}
@keyframes rl-blink{50%{opacity:.25}}
@keyframes rl-pulse{50%{transform:scale(1.09)}}
.rl-shaking .rl-shk{animation:rl-shk .38s ease-out}
@keyframes rl-shk{20%{transform:translateX(5px)} 45%{transform:translateX(-4px)} 70%{transform:translateX(2px)} 100%{transform:none}}
.rl-ring{fill:none; stroke:var(--rl-bump); stroke-width:5; transform-box:fill-box; transform-origin:center; animation:rl-ring .6s ease-out forwards}
.rl-ring.rl-static{animation:none; opacity:.95}
@keyframes rl-ring{from{transform:scale(.35); opacity:.95} to{transform:scale(1.7); opacity:0}}
.rl-hoverpath{fill:none !important;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.rl-hintpath-halo{fill:none; stroke:#FFFDF6; stroke-width:17; stroke-linecap:round; stroke-linejoin:round; opacity:.96}
.rl-hintpath{fill:none !important; stroke:#E3A12B !important; stroke-width:9; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:12 10; opacity:1; animation:rl-hint-flow .5s linear infinite}
.rl-hint-arrow{fill:#E3A12B; stroke:#FFFDF6; stroke-width:3; stroke-linejoin:round; paint-order:stroke; filter:drop-shadow(0 1px 2px rgba(75,54,24,.35))}
@keyframes rl-hint-flow{to{stroke-dashoffset:-22}}
@media (prefers-reduced-motion:reduce){
  .rl-ring{animation-duration:.01s} .rl-hintpath{animation:none} .rl-shaking .rl-shk,.rl-train.rl-hinted .rl-loco .rl-lift,.rl-train.rl-waiting .rl-lamp{animation:none} .rl-lift,.rl-sh{transition:none}
}

.rl-hoverpath,.rl-hint-group{pointer-events:none}
