/* pack19 2026-11-13 (owner): every <select> of the player site, one look in every browser. Loaded after main.css /
   mobile.css / modes.css (index.php). Components keep their own closed-select styling (wrappers + chevrons); this file
   only adds what they miss:
   1. all browsers: the OPEN list follows the dark UI (color-scheme: dark + option colours). Before, Chrome / Edge on
      Windows drew the checked option as a light-grey OS row on top of the dark list.
   2. a zero-specificity baseline for a bare <select> (no component rules): the site's field, chevron, hover.
   3. Chromium 135+ on a mouse / trackpad: `appearance: base-select` turns the list into the site's own popover.
      Phones and tablets (coarse pointer), Safari and Firefox keep their native pickers (the right UX on touch),
      dark thanks to 1. */

/* ---- 1. every browser: dark native list ---- */
select { color-scheme: dark; }
select option, select optgroup { background-color: #0e111a; color: #fff; } /*DESIGN-1204B:11ecea46*/
select option:checked { background-color: #242836; color: #fff; } /*DESIGN-1204B:10bf29eb*/
select option:disabled { color: #5c5c66; }
select optgroup { color: #8ba4ba; font-style: normal; font-weight: 600; } /*DESIGN-1204B:3c449154*/
select optgroup option { color: #fff; font-weight: 500; }

/* ---- 2. baseline for a bare select (any class rule of a component wins over :where) ---- */
:where(select) {
  box-sizing: border-box; max-width: 100%; height: 40px; padding: 0 36px 0 12px;
  border: 1px solid #131a26; border-radius: 9px; outline: 0; /*DESIGN-1204B:837b979e*/
  background: #090c13 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%23909090' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 14px no-repeat; /*DESIGN-1204B:92beb56a*/
  color: #fff; font: 500 14px 'Sora', sans-serif; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease-out;
}
:where(select:disabled) { cursor: not-allowed; }
:where(select[multiple], select[size]:not([size="1"])) { height: auto; padding: 4px; background-image: none; }
@media (hover: hover) { :where(select:hover:not(:disabled)) { border-color: #3a3a43; } }
@media only screen and (max-width: 1024px) { :where(select) { height: 44px; font-size: 16px; } } /* 16 px: iOS does not zoom */
@media (prefers-reduced-motion: reduce) { :where(select) { transition: none; } }

/* ---- 3. Chromium 135+, mouse / trackpad only: the site's own dropdown ----
   !important on appearance: the components set `appearance: none` with class selectors (and modes.css colours the
   options with `.mg-frame .mg-select select option`), so the picker rules need it to apply everywhere. */
@supports (appearance: base-select) {
  @media (hover: hover) and (pointer: fine) {
    select:not([multiple]):not([size]), select[size="1"] { appearance: base-select !important; align-items: center; white-space: nowrap; }
    select:not([multiple])::picker(select) {
      appearance: base-select;
      box-sizing: border-box; min-inline-size: anchor-size(self-inline); max-block-size: min(320px, 60vh);
      margin: 6px 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain;
      border: 1px solid #242936; border-radius: 12px; background: #0e111a; color: #fff; /*DESIGN-1204B:acde239a*/
      box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .35);
      scrollbar-width: thin; scrollbar-color: #3a3a43 transparent;
      opacity: 0; transition: opacity .12s ease-out, display .12s allow-discrete, overlay .12s allow-discrete;
    }
    select:not([multiple]):open::picker(select) { opacity: 1; }
    @starting-style { select:not([multiple]):open::picker(select) { opacity: 0; } }

    /* options: 40 px rows (44 when a touch screen is attached too), radius 8 inside the radius-12 picker */
    select:not([multiple]) option {
      display: flex; align-items: center; gap: 10px; min-block-size: 40px; padding: 0 10px; border-radius: 8px;
      background: transparent !important; color: #b9c9d6 !important; font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 500; line-height: 1.3; /*DESIGN-1204B:cbe9e6f7*/
      cursor: pointer; outline: none; transition: background-color .12s ease-out, color .12s ease-out;
    }
    select:not([multiple]) option + option { margin-top: 2px; }
    select:not([multiple]) option:hover, select:not([multiple]) option:focus-visible { background: #181c29 !important; color: #fff !important; } /*DESIGN-1204B:01a2b49f*/
    select:not([multiple]) option:checked { background: rgba(255, 206, 0, .08) !important; color: #fff !important; font-weight: 600; }
    select:not([multiple]) option:checked:hover, select:not([multiple]) option:checked:focus-visible { background: rgba(255, 206, 0, .13) !important; }
    select:not([multiple]) option:disabled { background: transparent !important; color: #5c5c66 !important; cursor: not-allowed; }
    select:not([multiple]) optgroup { padding: 4px 0 0; background: transparent; color: #8ba4ba; font: 600 12px 'Sora', sans-serif; } /*DESIGN-1204B:520ec363*/
    /* the selected row: a gold tick at the end (kept in place, invisible, on the others so labels line up) */
    select:not([multiple]) option::checkmark {
      order: 1; flex: none; margin-inline-start: auto; content: ''; width: 14px; height: 14px; background-color: #FFCE00;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
    }
    select:not([multiple]) option:not(:checked)::checkmark { visibility: hidden; }
    @media (any-pointer: coarse) { select:not([multiple]) option { min-block-size: 44px; } }

    /* the chevron: every select already draws the site's chevron (a sibling svg or a background image), so the
       browser's own icon is hidden. Open = the chevron points up: sibling svgs rotate, background chevrons swap. */
    select::picker-icon { display: none; }
    select:open + svg { rotate: 180deg; }
    .mg-frame .mg-select select:open + .mg-select-chev, .mpx-sortwrap select:open + .mpx-sort-chev { rotate: none; transform: translateY(-50%) rotate(180deg); }
    select:open:not(:has(+ svg)) {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 12.5 5-5 5 5' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    }

    /* base-select sizes a select to its CHOSEN label (not the longest option like the classic one): the sort selects
       whose width is auto get a floor on wide screens, so picking a shorter sort does not shrink the bar */
    @media (min-width: 1025px) {
      .cg-sort select, .dbx-sort select, .mpl-sort select, .ol-sort select, .sl-sort select, .gl-sort select { min-inline-size: 14em !important; }
    }

    @media (prefers-reduced-motion: no-preference) {
      select:not([multiple])::picker(select) { translate: 0 -4px; transition: opacity .15s ease-out, translate .15s cubic-bezier(.2, 0, 0, 1), display .15s allow-discrete, overlay .15s allow-discrete; }
      select:not([multiple]):open::picker(select) { translate: 0 0; }
      @starting-style { select:not([multiple]):open::picker(select) { translate: 0 -4px; } }
      select + svg { transition: rotate .15s cubic-bezier(.2, 0, 0, 1), transform .15s cubic-bezier(.2, 0, 0, 1); }
    }
    @media (prefers-reduced-motion: reduce) { select:not([multiple]) option { transition: none; } }
  }
}
