/* v9 PC web client fixes (desktop only, never body.mobile). Loaded LAST on games/ and play/ pages.
   1. Game Settings popup fits its chrome panel (no forced aspect ratio, list scrolls, OK below the list).
   2. Lobby footer buttons centred in each frame's bottom strip.
   3. Chat message box tinted glass (not white).
   4. User list: Do Not Disturb icon clear of the rating ball; account badge 2px lower.
   5. Scroll bars: chrome groove track, gold thumb with grip, gold arrow balls (icons/sb-*.svg). */

@media (min-width: 761px) {

  /* ---------- 1. Game Settings fits ---------- */
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#set-back, #game-set-back) .set-panel.set-panel {
    aspect-ratio: auto !important; height: auto !important; max-height: calc(100vh - 24px) !important;
    display: flex !important; flex-direction: column !important; overflow: hidden !important;
    padding: 6px 16px 14px !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#set-back, #game-set-back) .set-panel .set-body.set-body {
    display: flex !important; flex-direction: column !important; justify-content: flex-start !important; align-items: stretch !important;
    flex: 0 1 auto !important; min-height: 0 !important; height: auto !important;
    max-height: calc(100vh - 190px) !important; overflow-x: hidden !important; overflow-y: auto !important;
    padding: 4px 6px 4px !important; margin: 0 !important; gap: 2px !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#set-back, #game-set-back) .set-panel .set-opt {
    min-height: 26px !important; margin: 0 !important; flex: 0 0 auto !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#set-back, #game-set-back) .set-panel :is(#set-close, #game-set-close) {
    position: static !important; transform: none !important; flex: 0 0 auto !important;
    margin: 12px auto 0 !important; left: auto !important; top: auto !important; bottom: auto !important;
  }

  /* ---------- 2. Footer buttons centred in the bottom strip ---------- */
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body.game-page:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) #lobby-grid#lobby-grid#lobby-grid#lobby-grid :is(#games-pane, #players-pane) > .tools.tools {
    position: absolute !important; left: var(--rim, 27px) !important; right: var(--rim, 27px) !important;
    bottom: 7px !important; top: auto !important; height: calc(var(--ftr, 53px) - 7px) !important;
    width: auto !important; margin: 0 !important; padding: 0 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    transform: none !important; z-index: 4 !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body.game-page:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) #lobby-grid#lobby-grid#lobby-grid#lobby-grid #players-pane > .tools.tools {
    left: 22px !important; right: 22px !important; bottom: 10px !important; height: calc(var(--ftr, 81px) - 10px) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body.game-page:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) #lobby-grid#lobby-grid#lobby-grid#lobby-grid :is(#games-pane, #players-pane) > .tools > * {
    position: relative !important; top: auto !important; bottom: auto !important; transform: none !important; align-self: center !important; margin: 0 !important;
  }

  /* ---------- 3. Chat message box: tinted glass ---------- */
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body.game-page:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) #chat-input#chat-input {
    background: linear-gradient(180deg, #9fb0c6 0%, #bccadb 45%, #c9d5e3 100%) !important;
    border: 1px solid #6f8098 !important; border-radius: 17px 0 0 17px !important;
    box-shadow: inset 0 2px 4px rgba(20,35,60,.45), inset 0 -1px 0 rgba(255,255,255,.5), 0 1px 0 rgba(255,255,255,.6) !important;
    color: #13233a !important; caret-color: #1f5fd1 !important; font-weight: 600 !important; padding: 0 14px !important;
  }
    
  /* ---------- 4. User list icons ---------- */
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#players-pane, #side-players) :is(.user-row, .plist-row) .client .dnd-mark {
    transform: translate(calc(-50% - 5px), -50%) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#players-pane, #side-players) :is(.user-row, .plist-row) .rb {
    margin-left: 4px !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) :is(#players-pane, #side-players) :is(.user-row, .plist-row) .client :is(img.rk, .rk):is(.rk-admin, .rk-mod, .rk-vip, .rk-sub) {
    transform: translate(-40%, calc(-35% + 2px)) !important;
  }

  /* ---------- 5. Scroll bar graphics (lobby + game side panels) ---------- */
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-track.sb-track {
    width: 12px !important; border-radius: 6px !important; border: 0 !important;
    background:
      linear-gradient(90deg, rgba(0,0,0,.0) 0, rgba(0,0,0,.0) 100%),
      linear-gradient(90deg, #2c3a4c 0%, #56677d 30%, #6f8199 55%, #3c4b5f 100%) !important;
    box-shadow:
      inset 0 2px 3px rgba(0,0,0,.55), inset 0 -1px 2px rgba(255,255,255,.25),
      0 0 0 1px #8794a6, 0 0 0 2px rgba(255,255,255,.75), 0 1px 3px 2px rgba(20,30,50,.25) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-thumb.sb-thumb {
    left: 1px !important; right: 1px !important; width: auto !important; border-radius: 5px !important; border: 0 !important;
    min-height: 22px !important;
    background:
      url("/icons/sb-grip.svg") center / 8px 10px no-repeat,
      linear-gradient(90deg, #9a5a00 0%, #f0b21e 25%, #ffe58a 48%, #f4bb2a 70%, #a86400 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 1px rgba(90,50,0,.6), 0 1px 2px rgba(0,0,0,.45) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-thumb.sb-thumb:hover { filter: brightness(1.08) !important; }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn {
    background: url("/icons/sb-arrow-up.svg") center / 100% 100% no-repeat !important;
    border: 0 !important; border-radius: 50% !important; padding: 0 !important;
    box-shadow: 0 1px 3px rgba(20,30,50,.45) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn.sb-down {
    background-image: url("/icons/sb-arrow-down.svg") !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn::before,
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn::after { content: none !important; display: none !important; }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn:hover { filter: brightness(1.1) !important; }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12) .sb-col .sb-btn.sb-btn:is(:active, .sb-pressed) { filter: brightness(.88) !important; transform: translateY(1px) !important; }
}

/* v10: full-width user rows, games-pane buttons lifted to the strip centre, light blue scroll bars */
@media (min-width: 761px) {
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) #players-pane #user-log > * {
    margin-left: -4px !important; margin-right: 0 !important; width: calc(100% + 13px) !important; max-width: none !important;
    padding-right: 30px !important; box-sizing: border-box !important;
  }
    html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) #lobby-grid#lobby-grid#lobby-grid#lobby-grid #games-pane > .tools.tools { bottom: 11px !important; gap: 16px !important; }

  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) .sb-col .sb-track.sb-track {
    background: linear-gradient(90deg, #2f6fa6 0%, #6fb4e6 30%, #a9dcfb 55%, #4a8cc4 100%) !important;
    box-shadow: inset 0 2px 3px rgba(10,40,80,.55), inset 0 -1px 2px rgba(255,255,255,.35),
      0 0 0 1px #3d7fb8, 0 0 0 2px rgba(225,244,255,.85), 0 1px 3px 2px rgba(20,50,90,.25) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) .sb-col .sb-thumb.sb-thumb {
    background: url("/icons/sb-blue-grip.svg") center / 8px 10px no-repeat,
      linear-gradient(90deg, #2b78bd 0%, #7fd0ff 25%, #e4f7ff 48%, #8ad6ff 70%, #2f7fc4 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 1px rgba(10,50,100,.6), 0 1px 2px rgba(0,20,50,.45) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) .sb-col .sb-btn.sb-btn { background: url("/icons/sb-blue-up.svg") center / 100% 100% no-repeat !important; }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13) .sb-col .sb-btn.sb-btn.sb-down { background-image: url("/icons/sb-blue-down.svg") !important; }
}

/* v11: bigger scroll arrows tucked into the glass window's rounded corners, column hugging the right edge */
@media (min-width: 761px) {
          html:not(#_r1):not(#_r2):not(#_r3):not(#_r4):not(#_r5):not(#_r6) body.game-page:not(.mobile):not(#_r7):not(#_r8):not(#_r9) #lobby-grid#lobby-grid#lobby-grid#lobby-grid .pane > .sb-col > .sb-btn.sb-up { left: 0 !important; top: 0 !important; }
  html:not(#_r1):not(#_r2):not(#_r3):not(#_r4):not(#_r5):not(#_r6) body.game-page:not(.mobile):not(#_r7):not(#_r8):not(#_r9) #lobby-grid#lobby-grid#lobby-grid#lobby-grid .pane > .sb-col > .sb-btn.sb-down { left: 0 !important; bottom: 0 !important; }
  }

/* v13: scroll bar slot - a recessed background slot around each scroll column, and the groove now runs right up to
   the tip of the up and down buttons (no gap). */
@media (min-width: 761px) {
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13):not(#_q14) .sb-col.sb-col::before {
    content: "" !important; display: block !important; position: absolute !important; pointer-events: none !important;
    left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important; z-index: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(90deg, #b9c3cf 0%, #e6ebf1 50%, #b9c3cf 100%) !important;
    border: 1px solid #8e9aab !important; box-sizing: border-box !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.7) !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13):not(#_q14) .sb-col > .sb-track.sb-track {
    top: 28px !important; bottom: 28px !important; border-radius: 0 !important; z-index: 1 !important;
  }
  html:not(#_q1):not(#_q2):not(#_q3):not(#_q4):not(#_q5):not(#_q6):not(#_q7) body:not(.mobile):not(#_q8):not(#_q9):not(#_q10):not(#_q11):not(#_q12):not(#_q13):not(#_q14) .sb-col > .sb-slot { z-index: 2 !important; }
}

/* v16: fixed lobby size range + scroll bars on the glass edge.
   1. The lobby stage stays between 1240x700 and 1440x880 (pc-fit.js scales the whole stage down evenly when the
      window is smaller), so resizing the window never squashes the player list or its PLAYER / RATING header.
      Change the numbers here and in pc-fit.js together.
   2. Scroll columns sit 8px further right so the slot meets the glass window's right edge; the slot is exactly
      as wide as the column (was 36px wide with the bar off to its left). */
@media (min-width: 761px) {
  html:not(#_v1):not(#_v2):not(#_v3):not(#_v4):not(#_v5):not(#_v6):not(#_v7):not(#_v8) body.game-page:not(.mobile):not(#_v9):not(#_v10) #view-lobby #lobby-grid#lobby-grid#lobby-grid#lobby-grid {
    width: clamp(1240px, calc(100vw - 48px), 1440px) !important;
    height: clamp(700px, calc(100vh - 48px), 880px) !important;
    min-width: 1240px !important; max-width: 1440px !important;
    min-height: 700px !important; max-height: 880px !important;
    transform: translate(-50%, -50%) scale(var(--pcl-fit, 1)) !important;
    transform-origin: 50% 50% !important;
  }
    }
