/* The Trains island's glass over the world (trains/hud.js): the row of pieces the track tool goes through. */

#trains-picker {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

#trains-picker[hidden] {
  display: none;
}

#trains-picker button {
  width: 46px;
  height: 46px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(214, 244, 255, 0.7));
  cursor: pointer;
  touch-action: none;
}

#trains-picker button[aria-pressed="true"] {
  background: linear-gradient(180deg, #fff6d8, #ffd56a);
  border-color: #d9a441;
  box-shadow: 0 0 0 2px #d9a441, 0 2px 10px rgba(217, 164, 65, 0.6);
}

#trains-picker svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#trains-picker .rail {
  fill: none;
  stroke: #5b6b7d;
  stroke-width: 2.2;
  stroke-linecap: round;
}

#trains-picker .tie {
  fill: #9a6b3c;
}

#trains-picker .stop {
  fill: #e0301e;
}

#trains-picker .arrow {
  fill: none;
  stroke: #0a7fe0;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A phone: one row across the screen, over the use button. */
:root[data-touch="true"] #trains-picker {
  left: 8px;
  right: 8px;
  transform: none;
  bottom: calc(196px + env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 3px;
  padding: 4px;
}

:root[data-touch="true"] #trains-picker button {
  width: auto;
  flex: 1 1 0;
  max-width: 44px;
  height: 40px;
  padding: 3px;
}

/* Driving, the thumb stick is one upright lever: a slot of glass, and a brass handle that moves up and down it. */
#stick[data-lever] {
  background: none;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#stick[data-lever]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: 36px;
  margin-left: -18px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

#stick[data-lever] span {
  width: 72px;
  height: 26px;
  margin: -13px -36px;
  border-radius: 13px;
  background: radial-gradient(ellipse at 40% 25%, #fff 0 12%, transparent 45%), linear-gradient(180deg, #ffe7a0, #d9a441 60%, #a8742a);
  box-shadow: 0 3px 8px rgba(90, 50, 0, 0.45);
}
