/* scroll-3d.css (20261122b) - one look for every scroll bar in the lobbies and play pages (all three games, PC and
   phone): a steel-framed track, 3D buttons sitting in a recessed slot cut into the panel, a 3D thumb, and a
   greyed-out "disabled" face for the whole bar while there is nothing to scroll (scroll.js / mobile-hud.js put
   .sb-off on the .sb-col and aria-disabled on its buttons; it comes off as soon as the content overflows).

   The custom bars (.sb-col / .sb-slot / .sb-btn / .sb-track / .sb-thumb) are styled inside @layer sb3d with
   !important. Each page declares sb3d FIRST in its head @layer list, and the first-declared layer wins for
   !important, so this beats every unlayered rule and the later layers (lobby-depth glass etc.) - the many older
   per-page/per-skin overrides lose without a specificity race. It mostly paints (colours, bevels, shadows, round
   buttons, arrows). The one layout change is the PC steel frame's right rail (20261122b, see "rail" below): it is
   widened from 18px to 36px so the round buttons and the framed track sit fully inside the panel edge.
   Never set top/height on .sb-thumb here - scroll.js writes those inline. */

@layer sb3d {
  :root {
    --sb3-steel-hi: #e3e9f0;
    --sb3-steel: #9aa7b6;
    --sb3-steel-lo: #566373;
    --sb3-steel-edge: #18212c;
    --sb3-channel-a: #050c15;
    --sb3-channel-b: #142538;
    --sb3-face-hi: #a8f7cb;
    --sb3-face: #39bd7c;
    --sb3-face-mid: #1f8f59;
    --sb3-face-lo: #0d5535;
    --sb3-wall: #063a23;
    --sb3-arrow: #f3fff8;
    --sb3-off-hi: #c9d0d8;
    --sb3-off: #8a95a2;
    --sb3-off-lo: #535d69;
    --sb3-off-wall: #2c343e;
    --sb3-off-arrow: #3a434e;
  }

  /* ---- slot: a socket recessed into the panel, slightly larger than the button ---- */
  .sb-col .sb-slot { background: none !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; }
  .sb-col .sb-slot::after {
    content: "" !important; display: block !important; position: absolute !important;
    inset: -3px !important; width: auto !important; height: auto !important; margin: 0 !important; transform: none !important;
    border-radius: 50% !important; border: 1px solid rgba(0, 0, 0, .7) !important;
    background: linear-gradient(180deg, #03080e 0%, #0d1a29 55%, #1f3045 100%) !important;
    box-shadow:
      inset 0 3px 4px rgba(0, 0, 0, .95),
      inset 0 -1px 1px rgba(160, 190, 220, .22),
      0 1px 0 rgba(255, 255, 255, .38),
      0 -1px 0 rgba(0, 0, 0, .35) !important;
    z-index: 0 !important; pointer-events: none !important; opacity: 1 !important;
  }

  /* ---- 3D button: raised face + a 2px side wall that drops into the slot ---- */
  .sb-col .sb-btn {
    position: relative !important; z-index: 1 !important;
    border-radius: 50% !important; border: 1px solid var(--sb3-wall) !important;
    background: linear-gradient(180deg, var(--sb3-face-hi) 0%, var(--sb3-face) 22%, var(--sb3-face-mid) 60%, var(--sb3-face-lo) 100%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .8),
      inset 1px 0 0 rgba(255, 255, 255, .18),
      inset -1px 0 0 rgba(0, 0, 0, .18),
      inset 0 -2px 1px rgba(0, 0, 0, .32),
      0 2px 0 var(--sb3-wall),
      0 3px 3px rgba(0, 0, 0, .75) !important;
    transform: translateY(-1px) !important;
    transition: transform .06s ease, box-shadow .06s ease, filter .12s ease !important;
    cursor: pointer !important; opacity: 1 !important; filter: none !important;
  }
  .sb-col:not(.sb-off) .sb-btn:hover { filter: brightness(1.1) saturate(1.05) !important; }
  .sb-col:not(.sb-off) .sb-btn:is(.sb-pressed, :active) {
    transform: translateY(1px) !important;
    background: linear-gradient(180deg, var(--sb3-face) 0%, var(--sb3-face-mid) 55%, var(--sb3-face-lo) 100%) !important;
    box-shadow:
      inset 0 2px 3px rgba(0, 0, 0, .45),
      inset 0 -1px 0 rgba(255, 255, 255, .15),
      0 0 0 var(--sb3-wall),
      0 1px 1px rgba(0, 0, 0, .6) !important;
  }
  .sb-col .sb-btn:focus-visible { outline: 2px solid var(--sb3-face-hi) !important; outline-offset: 3px !important; }
  /* the old round-button sheen/ring is dropped */
  .sb-col .sb-btn::after { content: none !important; }

  /* chevron arrow, embossed */
  .sb-col .sb-btn::before {
    content: "" !important; display: block !important; position: absolute !important;
    left: 50% !important; top: 50% !important; right: auto !important; bottom: auto !important;
    width: 7px !important; height: 7px !important; margin: 0 !important; background: none !important;
    border-style: solid !important; border-color: var(--sb3-arrow) !important; border-width: 0 2.5px 2.5px 0 !important; border-radius: 1px !important;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .55)) !important; box-shadow: none !important; opacity: 1 !important;
  }
  .sb-col .sb-up::before { transform: translate(-50%, -25%) rotate(-135deg) !important; }
  .sb-col .sb-down::before { transform: translate(-50%, -75%) rotate(45deg) !important; }

  /* ---- framed track: recessed channel inside a steel frame (frame drawn with outer shadows, so no size change) ---- */
  .sb-col .sb-track {
    border-radius: 6px !important; border: 1px solid #000 !important;
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0) 44%, rgba(120, 160, 200, .12) 50%, rgba(0, 0, 0, 0) 56%),
      linear-gradient(90deg, var(--sb3-channel-a), var(--sb3-channel-b) 50%, var(--sb3-channel-a)) !important;
    box-shadow:
      inset 0 3px 4px rgba(0, 0, 0, .95),
      inset 0 -2px 3px rgba(0, 0, 0, .6),
      0 0 0 1px var(--sb3-steel-lo),
      0 -1px 0 2px var(--sb3-steel-hi),
      0 1px 0 2px var(--sb3-steel-lo),
      0 0 0 3px var(--sb3-steel),
      0 0 0 4px var(--sb3-steel-edge),
      0 2px 3px 4px rgba(0, 0, 0, .35) !important;
    opacity: 1 !important; filter: none !important;
  }
  .sb-col .sb-track::before, .sb-col .sb-track::after { content: none !important; }
  /* rail (PC): the steel frame (desktop-one-layout.css: --snkf-rr on the play panels, --snk-frame-rail-r on the
     lobby panels, both 18px) sizes its right rail, padding and dark inset from one variable. Widen it on every panel that carries a scroll column so the 27px round button (33px socket)
     and the 18px framed track fit inside the panel's right edge instead of straddling the inset corner; the
     panel's outer size is unchanged, its content area is 18px narrower. */
  body:not(.mobile) :has(> .sb-col) { --snkf-rr: 36px !important; --snk-frame-rail-r: 36px !important; }
  body:not(.mobile) .sb-col { width: var(--snkf-rr, 18px) !important; left: auto !important; right: 0 !important; }
  body:not(.mobile) .sb-col .sb-slot { left: calc(50% - 13.5px) !important; right: auto !important; }
  body:not(.mobile) .sb-col .sb-track { left: calc(50% - 5px) !important; right: calc(50% - 5px) !important; }
  /* phones: the glass skins draw a 6px track; widen it to 10px (centred) so the framed channel and thumb read */
  body.mobile .sb-col .sb-track { min-width: 10px !important; transform: translateX(-2px) !important; }

  /* ---- 3D thumb ---- */
  .sb-col .sb-thumb {
    border-radius: 6px !important; border: 1px solid #04301d !important;
    background: linear-gradient(90deg, #0b5a38 0%, #33c47f 26%, #b9ffd9 46%, #4fd795 62%, #138152 84%, #0a4a2e 100%) !important;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, .55),
      inset 0 -2px 0 rgba(0, 0, 0, .35),
      0 2px 3px rgba(0, 0, 0, .85),
      0 0 4px rgba(70, 230, 150, .35) !important;
    left: 0 !important; right: 0 !important; width: auto !important;
    opacity: 1 !important; filter: none !important; cursor: grab !important;
  }
  .sb-col.sb-held .sb-thumb { cursor: grabbing !important; filter: brightness(1.08) !important; }
  .sb-col .sb-thumb::before { content: none !important; }
  .sb-col .sb-thumb::after {
    content: "" !important; display: block !important; position: absolute !important;
    left: 2px !important; right: 2px !important; top: 50% !important; bottom: auto !important;
    width: auto !important; height: 7px !important; margin: 0 !important; transform: translateY(-50%) !important;
    background: repeating-linear-gradient(180deg, rgba(3, 40, 24, .85) 0 1px, rgba(255, 255, 255, .45) 1px 2px, transparent 2px 3px) !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important; opacity: 1 !important;
  }

  /* ---- disabled: nothing to scroll ---- */
  .sb-col.sb-off .sb-btn {
    border-color: var(--sb3-off-wall) !important;
    background: linear-gradient(180deg, var(--sb3-off-hi) 0%, var(--sb3-off) 30%, var(--sb3-off-lo) 100%) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .55),
      inset 0 -2px 1px rgba(0, 0, 0, .28),
      0 2px 0 var(--sb3-off-wall),
      0 3px 3px rgba(0, 0, 0, .6) !important;
    cursor: default !important; filter: saturate(.6) brightness(.82) !important;
  }
  .sb-col.sb-off .sb-btn::before {
    border-color: var(--sb3-off-arrow) !important;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .35)) !important;
  }
  .sb-col.sb-off .sb-track {
    filter: saturate(0) brightness(.85) !important;
    background:
      repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 3px, transparent 3px 7px),
      linear-gradient(90deg, #070b10, #151b23 50%, #070b10) !important;
  }
  .sb-col.sb-off .sb-thumb { display: none !important; }
}

/* ---- native scroll bars (settings popups, profile card and other overflow panels on game pages) ----
   Blink/WebKit only: theme.css makes every element "thin", which in Chrome 121+ switches the ::-webkit-scrollbar
   art off, so set width/colour back to auto here (same specificity as theme.css, loaded later, NOT !important -
   any list that hides its bar on purpose has a more specific or !important rule and keeps it hidden).
   Native bars only appear when there is something to scroll, so they need no disabled face. Firefox keeps the
   thin themed bar. */
@supports selector(::-webkit-scrollbar) {
  html[data-theme] :is(.game-page, .gameplay-page) * { scrollbar-width: auto; scrollbar-color: auto; }
  html[data-theme] :is(.game-page, .gameplay-page) ::-webkit-scrollbar { width: 16px; height: 16px; }
  html[data-theme] :is(.game-page, .gameplay-page) ::-webkit-scrollbar-track {
    border-radius: 8px; border: 3px solid #8995a4; background: linear-gradient(90deg, #050c15, #142538 50%, #050c15) padding-box;
    box-shadow: inset 0 3px 4px rgba(0, 0, 0, .9), 0 0 0 1px #18212c;
  }
  html[data-theme] :is(.game-page, .gameplay-page) ::-webkit-scrollbar-thumb {
    border-radius: 8px; border: 4px solid transparent; background-clip: padding-box;
    background-color: #2aa96c;
    background-image: linear-gradient(90deg, #0b5a38, #39c985 30%, #b9ffd9 50%, #39c985 70%, #0b5a38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .4);
  }
  html[data-theme] :is(.game-page, .gameplay-page) ::-webkit-scrollbar-thumb:hover { background-color: #3cc983; }
  /* buttons: Chrome drops scrollbar-button art when the selector has :is() before the pseudo-element, so these
     rules spell out .game-page and .gameplay-page separately */
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button {
    display: block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid #063a23;
    background-color: #1f8f59; background-repeat: no-repeat; background-position: center; background-size: 8px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 1px rgba(0, 0, 0, .35);
  }
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button:active,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button:active { background-color: #167046; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5); }
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button:vertical:decrement,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 6 4 2.5 7 6' fill='none' stroke='%23f3fff8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button:vertical:increment,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 2 4 5.5 7 2' fill='none' stroke='%23f3fff8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button:horizontal:decrement,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M6 1 2.5 4 6 7' fill='none' stroke='%23f3fff8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  html[data-theme] .game-page ::-webkit-scrollbar-button:single-button:horizontal:increment,
  html[data-theme] .gameplay-page ::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M2 1 5.5 4 2 7' fill='none' stroke='%23f3fff8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  html[data-theme] :is(.game-page, .gameplay-page) ::-webkit-scrollbar-corner { background: transparent; }
}
