/* Train driving HUD (see train-kit.js driverHud). Sits on top of /simulation-games/_shared/sim3d.css */
.tk-hud { position: absolute; left: 10px; top: 10px; display: grid; grid-template-columns: auto auto; gap: 6px; align-items: start; }
.tk-hud > div { background: rgba(8, 16, 28, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; }
.tk-speedo { position: relative; padding: 6px 12px 5px; min-width: 92px; text-align: center; line-height: 1; }
.tk-speedo b { display: block; font-size: 30px; font-variant-numeric: tabular-nums; }
.tk-speedo small { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.tk-limit { position: absolute; right: -10px; top: -8px; min-width: 30px; height: 30px; padding: 0 3px; border-radius: 6px; background: #fff; color: #111; border: 2px solid #111;
  font: 800 14px/26px system-ui, sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.tk-speedo.is-over { border-color: #ff5b5b; background: rgba(120, 10, 10, .72); }
.tk-speedo.is-over .tk-limit { background: #ffd54a; animation: tk-blink .5s steps(2) infinite; }
@keyframes tk-blink { 50% { opacity: .5; } }
.tk-handle { grid-column: 1 / -1; padding: 6px 9px 5px; width: 190px; }
.tk-handle__track { position: relative; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.tk-handle__fill { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; }
.tk-handle__zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; opacity: .8; }
.tk-handle__lbl { display: block; margin-top: 3px; font: 800 11px system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; opacity: .9; }
.tk-handle.is-emerg { border-color: #ff5b5b; background: rgba(120, 10, 10, .72); }
.tk-next { padding: 5px 10px; max-width: 170px; line-height: 1.15; }
.tk-next small { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.tk-next b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-next span { font: 700 12px system-ui, sans-serif; color: #ffd54a; font-variant-numeric: tabular-nums; }
.tk-sig { grid-column: 1; display: flex; align-items: center; gap: 4px; padding: 5px 8px; width: max-content; }
.tk-sig i { width: 12px; height: 12px; border-radius: 50%; background: #2a2d33; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.tk-sig small { font: 700 11px system-ui, sans-serif; margin-left: 4px; opacity: .9; }
.tk-sig[data-aspect="0"] i:nth-child(1) { background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; }
.tk-sig[data-aspect="1"] i:nth-child(2) { background: #ffc21a; box-shadow: 0 0 8px #ffc21a; }
.tk-sig[data-aspect="2"] i:nth-child(3) { background: #2fe06a; box-shadow: 0 0 8px #2fe06a; }
.tk-sig[data-aspect=""] { opacity: .45; }
.tk-clock { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 4px 12px; text-align: center; line-height: 1.1;
  background: rgba(8, 16, 28, .66); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; }
.tk-clock b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.tk-late { font: 700 10px system-ui, sans-serif; opacity: .9; }
.tk-late.is-late { color: #ff8a8a; } .tk-late.is-early { color: #9ad7ff; } .tk-late.is-ok { color: #7cf29a; }

/* doors indicator + station stop guide */
.tk-doors { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 5px 12px; border-radius: 10px; font: 800 12px system-ui, sans-serif;
  background: rgba(8, 16, 28, .72); border: 1px solid rgba(255, 255, 255, .2); display: none; }
.tk-doors.is-on { display: block; }
.tk-doors.is-open { border-color: #4ade80; color: #bbf7d0; }
.tk-stopbar { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); width: min(300px, 60%); display: none; text-align: center; font: 800 11px system-ui, sans-serif; }
.tk-stopbar.is-on { display: block; }
.tk-stopbar__track { position: relative; height: 10px; margin-top: 3px; border-radius: 5px; background: rgba(8, 16, 28, .7); border: 1px solid rgba(255, 255, 255, .25); }
.tk-stopbar__zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; background: rgba(74, 222, 128, .55); }
.tk-stopbar__dot { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: #ffd54a; box-shadow: 0 0 6px #ffd54a; }

@container (max-width: 480px) {
  .tk-hud { left: 6px; top: 6px; gap: 4px; }
  .tk-speedo { min-width: 62px; padding: 4px 8px; }
  .tk-speedo b { font-size: 20px; }
  .tk-limit { min-width: 24px; height: 24px; font-size: 12px; line-height: 20px; right: -8px; top: -6px; }
  .tk-handle { width: 132px; padding: 4px 6px; }
  .tk-next { max-width: 116px; padding: 4px 7px; }
  .tk-next b { font-size: 12px; }
  .tk-clock { top: auto; bottom: 8px; padding: 3px 8px; }
  .tk-clock b { font-size: 13px; }
  .sim-has-touch .tk-clock { bottom: auto; top: 118px; left: 8px; transform: none; }
  .sim-has-touch .tk-stopbar { bottom: 70px; left: 45%; width: 52%; }
  .sim-has-touch .tk-doors { bottom: 104px; left: 45%; }
  /* the train HUD is taller than the flight one: toolbar becomes a column under the minimap */
  .sim-toolbar { top: 92px; right: 8px; left: auto; bottom: auto; flex-direction: column; flex-wrap: nowrap; }
}
/* touch buttons without a stick: start at the left edge */
.tk-nostick .sim-tbtns { left: 12px; }
