/* Rail Yard: a shunting yard at dusk, coaches in bazaar colours */
.ry-col { gap: 4px; padding: 6px 8px 4px; }
.ry-yard {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 600px;
  min-height: 0;
  direction: ltr;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(90% 60% at 80% 0%, rgba(255, 153, 51, 0.16), rgba(255, 153, 51, 0) 70%),
    linear-gradient(#4A1428, #2E0A18);
  box-shadow: inset 0 0 0 2px rgba(255, 177, 59, 0.32), 0 10px 26px rgba(0, 0, 0, 0.4);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
.ry-tracks { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.ry-sleepers { stroke: #6B3A2A; stroke-width: 11; stroke-dasharray: 3 6; fill: none; }
.ry-rails { stroke: #E2B9C4; stroke-opacity: 0.75; stroke-width: 1.6; fill: none; }
.ry-buffer { fill: #D81B78; stroke: #FFD592; stroke-width: 1.2; }
.ry-platform { fill: #F4C430; fill-opacity: 0.22; }
.ry-lane {
  position: absolute;
  left: 0; right: 0;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s;
}
.ry-lane:focus-visible { outline: 3px solid #FFF4E0; outline-offset: -4px; border-radius: 12px; }
.ry-lane.is-target { background: rgba(31, 162, 166, 0.16); box-shadow: inset 0 0 0 2px rgba(31, 162, 166, 0.55); border-radius: 12px; }
.ry-lane.is-hint { animation: ry-hint 0.6s ease-in-out 3 alternate; border-radius: 12px; }
@keyframes ry-hint { from { background: rgba(255, 177, 59, 0.05); } to { background: rgba(255, 177, 59, 0.3); } }
.is-stuck .ry-lane--main { background: rgba(216, 27, 120, 0.1); }
.is-stuck ~ .kit-status { color: #FF8CC0; }

.ry-coach, .ry-engine {
  position: absolute;
  left: 0; top: 0;
  width: var(--cw); height: var(--ch);
  pointer-events: none;
  transition: transform 0.32s ease-in-out, translate 0.18s, filter 0.18s;
  will-change: transform;
}
.ry-coach svg, .ry-engine svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ry-coach b {
  position: absolute;
  left: 0; right: 0; top: 47%;
  transform: translateY(-50%);
  font: 800 var(--fs) / 1 var(--font-body, system-ui), sans-serif;
  letter-spacing: -0.03em;
  color: #260813;
  text-align: center;
}
.ry-coach.is-sel { translate: 0 -9px; filter: drop-shadow(0 0 6px #FFB13B) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4)); z-index: 2; }
.ry-coach.is-no { animation: ry-no 0.36s; }
@keyframes ry-no { 0%, 100% { translate: 0 -9px; } 25% { translate: -5px -9px; } 75% { translate: 5px -9px; } }
.ry-engine { width: calc(var(--ch) * 2); }
.is-leaving .ry-engine, .is-leaving .ry-coach.is-out { translate: 110vw 0; transition: translate 1.3s cubic-bezier(0.5, 0, 0.8, 0.6); }

.ry-sign {
  position: absolute;
  top: 6px; left: 50%;
  display: flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 2px 12px 0;
  transform: translateX(-50%);
  border-radius: 16px 16px 6px 6px;
  background: #FFF4E0;
  box-shadow: 0 0 0 2px #FF9933, 0 0 0 4px #260813, 0 4px 10px rgba(0, 0, 0, 0.35);
  color: #3A0E1E;
}
.ry-sign::before, .ry-sign::after {
  content: ""; position: absolute; top: -10px; width: 2px; height: 10px; background: #FFB13B;
}
.ry-sign::before { left: 18px; }
.ry-sign::after { right: 18px; }
.ry-sign__n { font: 400 22px/1 var(--font-display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.ry-sign__n i { font-style: normal; margin: 0 3px; color: #B0245A; }
.ry-sign.is-bump .ry-sign__n { animation: ry-bump 0.3s; }
@keyframes ry-bump { 50% { transform: scale(1.18); } }
.ry-bell {
  position: relative;
  width: 16px; height: 16px;
  border-radius: 8px 8px 3px 3px;
  background: #F4C430;
  box-shadow: inset -3px 0 0 rgba(176, 36, 90, 0.35);
  transform-origin: 50% 0;
}
.ry-bell::after { content: ""; position: absolute; left: 5px; bottom: -4px; width: 6px; height: 4px; border-radius: 0 0 3px 3px; background: #B0245A; }
.ry-sign.is-ring .ry-bell { animation: ry-ring 0.3s ease-in-out 5 alternate; }
@keyframes ry-ring { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }

@media (prefers-reduced-motion: reduce) {
  .ry-coach, .ry-engine { transition: none; }
  .ry-bell, .ry-sign__n, .ry-lane.is-hint { animation: none !important; }
}
.ry-hall { fill: #56182E; }
.ry-arch { fill: #2E0A18; stroke: #FF9933; stroke-opacity: 0.55; stroke-width: 2; }
.ry-scallop { fill: #B0245A; }
.ry-ledge { fill: #FFB13B; fill-opacity: 0.55; }
