/* Scrollbars that belong to the sky: a slim dark groove, like an orbit line, with a thumb that glows cyan into violet and turns
   sun-amber while it is held. Shared by the site and the Captain's console.
   Touch screens keep their own overlay scrollbars (custom ones would take up room there), and so does high-contrast mode,
   which has to use the system's colours. */

/* The whole site is dark, so the browser's own bars (touch, high contrast) and controls start from the dark scheme too. */
:root { color-scheme: dark; }

@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  ::-webkit-scrollbar { width: 14px; height: 14px; }
  ::-webkit-scrollbar-button { display: none; }
  ::-webkit-scrollbar-corner { background: transparent; }

  /* The groove stays clear of rounded corners, and has a faint outline so it shows on any backdrop. */
  ::-webkit-scrollbar-track {
    border: solid transparent;
    border-radius: 999px;
    background: rgba(2, 6, 16, .6) padding-box;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  }
  ::-webkit-scrollbar-track:vertical { border-width: 0 3px; margin: 16px 0; }
  ::-webkit-scrollbar-track:horizontal { border-width: 3px 0; margin: 0 16px; }

  /* A long list makes a tiny thumb, so it never gets shorter than something you can grab. */
  ::-webkit-scrollbar-thumb {
    border: solid transparent;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(3, 7, 18, .45);
  }
  ::-webkit-scrollbar-thumb:vertical {
    border-width: 0 4px;
    min-height: 44px;
    background: linear-gradient(180deg, #61d8dc, #897cff) padding-box;
  }
  ::-webkit-scrollbar-thumb:horizontal {
    border-width: 4px 0;
    min-width: 44px;
    background: linear-gradient(90deg, #61d8dc, #897cff) padding-box;
  }
  ::-webkit-scrollbar-thumb:vertical:hover { background: linear-gradient(180deg, #9ff1f3, #b2a8ff) padding-box; }
  ::-webkit-scrollbar-thumb:horizontal:hover { background: linear-gradient(90deg, #9ff1f3, #b2a8ff) padding-box; }
  ::-webkit-scrollbar-thumb:vertical:active { background: linear-gradient(180deg, #ffe2a8, #ffcc70) padding-box; }
  ::-webkit-scrollbar-thumb:horizontal:active { background: linear-gradient(90deg, #ffe2a8, #ffcc70) padding-box; }
}

/* Browsers without the pseudo-elements (Firefox) get the standard properties, which can only set two colours. Chromium must not see
   them: once scrollbar-color is set, it ignores everything above. */
@supports not selector(::-webkit-scrollbar) {
  @media (hover: hover) and (pointer: fine) and (forced-colors: none) {
    * { scrollbar-width: thin; scrollbar-color: #61d8dc rgba(2, 6, 16, .6); }
  }
}
