/* Art of War 3 / Refrigerator Deluxe - game menu dropdown standard (V11.4).
   Visual-only: keep all existing picker engines, controls, callbacks and form fields.
   Loaded AFTER per-page CSS and aow_game_ui.css to supersede the many legacy
   dropdown skins without changing the bracket or scrolling rules. */
body.aow-masters-theme {
  --aow-dd-outline: #568e86;
  --aow-dd-bright: #82c9bd;
  --aow-dd-text: #f1f9f4;
  --aow-dd-muted: #acc9c0;
  --aow-dd-active: #578d79;
  --aow-dd-active-border: #6eb49e;
  --aow-dd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='m3 5 9 5 9-5 M3 11l9 5 9-5' fill='none' stroke='%2359cfd0' stroke-width='3.4' stroke-linejoin='miter'/%3E%3C/svg%3E");
}
/* 1) One trigger treatment for the site's different independent dropdown engines.
      Class inventories verified from V11.3 page templates and scripts. */
body.aow-masters-theme :is(
  .aow-select-trigger,
  .portal-select-trigger,
  .ms-ui-select-trigger,
  .ms-custom-select-trigger,
  .bracket-team-picker-trigger,
  .bracket-format-trigger,
  .results-custom-select-trigger,
  .results-team-select-trigger,
  .p6g-picker-trigger
) {
  box-sizing:border-box!important;
  position:relative!important;
  min-height:48px!important;
  border:1px solid var(--aow-dd-outline)!important;
  border-radius:0!important;
  padding:10px 48px 10px 13px!important;
  background:linear-gradient(180deg,#061514 0%,#020b0b 100%)!important;
  color:var(--aow-dd-text)!important;
  font-family:var(--aow-heading, 'Refrigerator Deluxe', sans-serif)!important;
  font-weight:700!important;
  font-size:20px!important;
  line-height:1.12!important;
  text-align:left!important;
  text-shadow:0 1px 1px #000!important;
  outline:0!important;
  box-shadow:inset 0 1px 0 rgba(124,207,194,.35),inset 0 -1px 0 #000,0 0 0 2px rgba(28,69,65,.25)!important;
  cursor:pointer;
}
/* The game uses TWO cyan chevrons, not the old purple single down-arrow. */
body.aow-masters-theme :is(
  .aow-select-trigger,
  .portal-select-trigger,
  .ms-ui-select-trigger,
  .ms-custom-select-trigger,
  .bracket-team-picker-trigger,
  .bracket-format-trigger,
  .results-custom-select-trigger,
  .results-team-select-trigger,
  .p6g-picker-trigger
)::after {
  content:""!important;
  position:absolute!important;
  inset:auto 12px auto auto!important;
  top:50%!important;
  width:24px!important;
  height:24px!important;
  transform:translateY(-50%)!important;
  background:var(--aow-dd-arrow) center / 24px 24px no-repeat!important;
  box-shadow:none!important;
  border:0!important;
  opacity:1!important;
  pointer-events:none!important;
  display:block!important;
}
/* Hide each legacy arrow; don't touch faction and team icons. */
body.aow-masters-theme :is(
  .aow-select-chevron,.portal-select-arrow,.ms-ui-select-caret,
  .ms-custom-select-chevron,.ms-custom-select-caret,.picker-chevron,
  .format-chevron,.results-custom-select-arrow,.results-team-select-arrow
){display:none!important}
body.aow-masters-theme .p6g-picker-trigger > svg{display:none!important}
body.aow-masters-theme :is(
  .aow-select-trigger,.portal-select-trigger,.ms-ui-select-trigger,
  .ms-custom-select-trigger,.bracket-team-picker-trigger,.bracket-format-trigger,
  .results-custom-select-trigger,.results-team-select-trigger,.p6g-picker-trigger
):is(:hover,:focus-visible,[aria-expanded='true']) {
  border-color:var(--aow-dd-bright)!important;
  background:linear-gradient(180deg,#0b2623 0%,#031210 100%)!important;
  box-shadow:inset 0 1px 0 #78baaf,0 0 0 2px rgba(65,172,156,.18)!important;
}
body.aow-masters-theme :is(
  .aow-select.open .aow-select-trigger,
  .portal-select.open .portal-select-trigger,
  .ms-ui-select.is-open .ms-ui-select-trigger,
  .ms-custom-select.open .ms-custom-select-trigger,
  .bracket-team-picker.open .bracket-team-picker-trigger,
  .bracket-format-picker.open .bracket-format-trigger,
  .results-custom-select.open .results-custom-select-trigger,
  .results-team-select.open .results-team-select-trigger
){border-color:var(--aow-dd-bright)!important;box-shadow:0 0 0 2px rgba(89,201,185,.22)!important}
/* 2) All dropdown menus: opaque striped near-black, teal metal border, square. */
body.aow-masters-theme :is(
  .aow-select-menu,.portal-select-menu,.ms-ui-select-menu,
  .ms-custom-select-menu,.ms-custom-select-options,
  .bracket-team-picker-menu,.bracket-format-menu,
  .results-custom-select-menu,.results-team-select-menu,
  .p6g-picker-menu
){
  box-sizing:border-box!important;
  border:1px solid var(--aow-dd-outline)!important;
  border-radius:0!important;
  padding:6px!important;
  background:
    repeating-linear-gradient(180deg,rgba(48,108,96,.085) 0px,rgba(48,108,96,.085) 1px,transparent 1px,transparent 4px),
    linear-gradient(180deg,#061512,#010808)!important;
  color:var(--aow-dd-text)!important;
  box-shadow:inset 0 2px 0 rgba(106,196,179,.32),0 12px 28px rgba(0,0,0,.85)!important;
  scrollbar-color:#408f86 #031412!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
/* Preserve each component's own open/close logic. */
body.aow-masters-theme :is(
  .aow-select-menu,.portal-select-menu,.ms-ui-select-menu,
  .ms-custom-select-menu,.ms-custom-select-options,
  .bracket-team-picker-menu,.bracket-format-menu,
  .results-custom-select-menu,.results-team-select-menu,
  .p6g-picker-menu
)[hidden]{display:none!important}
body.aow-masters-theme :is(
  .aow-select-menu,.portal-select-menu,.ms-ui-select-menu,
  .ms-custom-select-menu,.bracket-team-picker-menu,.bracket-format-menu,
  .results-custom-select-menu,.results-team-select-menu,.p6g-picker-menu
)::-webkit-scrollbar{width:8px!important}
body.aow-masters-theme :is(
  .aow-select-menu,.portal-select-menu,.ms-ui-select-menu,
  .ms-custom-select-menu,.bracket-team-picker-menu,.bracket-format-menu,
  .results-custom-select-menu,.results-team-select-menu,.p6g-picker-menu
)::-webkit-scrollbar-thumb{background:#408f86!important;border:1px solid #092724!important;border-radius:0!important}
/* 3) Menu rows: preserve labels, search, faction icons, details and keyboard focus. */
body.aow-masters-theme :is(
  .aow-select-option,.portal-select-option,.ms-ui-select-option,
  .ms-custom-select-option,.picker-option,.bracket-format-option,
  .results-custom-select-option,.results-team-select-option,.p6g-picker-option
){
  box-sizing:border-box!important;
  border:1px solid transparent!important;
  border-radius:0!important;
  background:transparent!important;
  min-height:44px!important;
  padding:8px 12px!important;
  color:var(--aow-dd-text)!important;
  font-family:var(--aow-heading,'Refrigerator Deluxe',sans-serif)!important;
  font-weight:700!important;
  font-size:20px!important;
  line-height:1.15!important;
  text-align:left!important;
  text-shadow:0 1px 1px #0008!important;
  box-shadow:none!important;
}
body.aow-masters-theme :is(
  .aow-select-option,.portal-select-option,.ms-ui-select-option,
  .ms-custom-select-option,.picker-option,.bracket-format-option,
  .results-custom-select-option,.results-team-select-option,.p6g-picker-option
):is(:hover,:focus-visible){
  background:#275e51!important;
  border-color:#5aa692!important;
  color:#fff!important;
  outline:0!important;
}
/* The game screenshot highlights the active row in muted seafoam green.
   Selection color is deliberately independent of gold bracket-round buttons. */
body.aow-masters-theme :is(
  .aow-select-option.selected,.aow-select-option[aria-selected='true'],
  .portal-select-option.selected,.portal-select-option[aria-selected='true'],
  .ms-ui-select-option.selected,.ms-ui-select-option.is-selected,
  .ms-custom-select-option.selected,.ms-custom-select-option.is-selected,
  .picker-option.selected,.picker-option[aria-selected='true'],
  .bracket-format-option.selected,.bracket-format-option[aria-selected='true'],
  .results-custom-select-option.selected,.results-team-select-option.selected,
  .p6g-picker-option.is-selected,.p6g-picker-option[aria-selected='true']
){
  background:linear-gradient(180deg,#619a86,#4c846f)!important;
  border-color:var(--aow-dd-active-border)!important;
  color:#fff!important;
  box-shadow:inset 4px 0 #8bd6be!important;
  text-shadow:0 1px 1px #163c34!important;
}
body.aow-masters-theme :is(
  .aow-select-option.selected,.portal-select-option.selected,
  .ms-ui-select-option.is-selected,.ms-custom-select-option.selected,
  .picker-option.selected,.bracket-format-option.selected,
  .results-custom-select-option.selected,.results-team-select-option.selected,
  .p6g-picker-option.is-selected
):is(:hover,:focus-visible){background:#6aa994!important}
body.aow-masters-theme :is(
  .picker-check,.format-check,.aow-select-tick,.ms-custom-select-check,
  .results-custom-select-check,.results-team-select-check
){color:#a8e5d6!important;border-color:#a8e5d6!important}
/* No separate purple inner highlight for special controls. */
body.aow-masters-theme :is(
  .aow-select-value,.portal-select-value,.ms-custom-select-value,
  .results-custom-select-value,.results-team-select-current,
  .picker-current,.bracket-format-trigger strong
){color:var(--aow-dd-text)!important}
body.aow-masters-theme :is(
  .picker-option-text small,.picker-current small,
  .results-team-select-option-main small,
  .bracket-format-option small,.bracket-format-trigger small,
  .portal-select-copy small
){color:#bad6cb!important}
body.aow-masters-theme :is(.picker-search,.results-team-select-search,.ms-custom-select-search){
  border-radius:0!important;background:#041715!important;color:#ebf7f1!important;
  border-color:#568e86!important;
}
/* 4) Native select fallback: preserve native form operation and only skin visible
   selects not already paired with a custom widget. Specialist selects should
   normally be hidden by their page's own script. */
body.aow-masters-theme select:not(.portal-native-select):not(.aow-native-select-enhanced):not(.ms-backed-select):not([hidden]){
  border:1px solid var(--aow-dd-outline)!important;
  border-radius:0!important;
  background-color:#03100f!important;
  color:#f1f9f4!important;
  font-family:var(--aow-heading,'Refrigerator Deluxe',sans-serif)!important;
}
/* The global enhancer hides only the native field after mounting its button. */
body.aow-masters-theme select.aow-native-select-enhanced{
  position:absolute!important;width:1px!important;height:1px!important;
  clip-path:inset(50%)!important;opacity:0!important;pointer-events:none!important;
}
/* Preserve phone scrolling and modal scroll locks; controls remain in-flow. */
@media (max-width:760px){
  body.aow-masters-theme :is(
    .aow-select-trigger,.portal-select-trigger,.ms-ui-select-trigger,
    .ms-custom-select-trigger,.bracket-team-picker-trigger,.bracket-format-trigger,
    .results-custom-select-trigger,.results-team-select-trigger,.p6g-picker-trigger
  ){max-width:100%!important;min-width:0!important;font-size:18px!important}
  body.aow-masters-theme :is(
    .aow-select-menu,.portal-select-menu,.ms-ui-select-menu,
    .ms-custom-select-menu,.bracket-team-picker-menu,.bracket-format-menu,
    .results-custom-select-menu,.results-team-select-menu,.p6g-picker-menu
  ){max-height:min(320px,48dvh)!important;overscroll-behavior:contain!important}
}
/* Higher-specificity open states from the old templates must not revert the
   double-chevron black game selector back to the previous metallic blue. */
body.aow-masters-theme :is(
  .ms-custom-select.open .ms-custom-select-trigger,
  .ms-ui-select.is-open .ms-ui-select-trigger,
  .portal-select.open .portal-select-trigger,
  .aow-select.open .aow-select-trigger,
  .bracket-team-picker.open .bracket-team-picker-trigger,
  .bracket-format-picker.open .bracket-format-trigger,
  .results-custom-select.open .results-custom-select-trigger,
  .results-team-select.open .results-team-select-trigger,
  .p6g-category-picker .p6g-picker-trigger[aria-expanded='true']
){background:linear-gradient(180deg,#0b2623,#031210)!important;border-radius:0!important}
/* Team labels within an active row use the same white text as the game menu,
   while their Confederation/Resistance icons and secondary labels remain. */
body.aow-masters-theme :is(
  .results-team-select-option.selected,.picker-option.selected,
  .portal-select-option.selected,.bracket-format-option.selected
) :is(strong,span:not(.picker-faction-icon):not(.picker-tbd-icon)){
  color:#fff!important;
}

/* V11.5 — every TEAM selector follows the Final Placement faction-icon picker.
   The logo carries faction identity; show the team name once, prominently. */
body.aow-masters-theme :is(
  .bracket-team-picker .picker-option-text small,
  .bracket-team-picker .picker-current small,
  .results-team-select .results-team-select-option-main small,
  .results-team-select .results-team-select-current small,
  .correction-technical-picker .correction-picker-faction
){display:none!important}
body.aow-masters-theme :is(
  .bracket-team-picker .picker-option,
  .results-team-select .results-team-select-option,
  .aow-select-team-option,
  .correction-technical-picker .picker-option
){min-height:54px!important;display:flex!important;align-items:center!important;gap:12px!important;border-radius:0!important}
body.aow-masters-theme :is(
  .bracket-team-picker .picker-current,
  .bracket-team-picker .picker-option-text,
  .results-team-select .results-team-select-current,
  .results-team-select .results-team-select-option-main,
  .aow-select-team
){display:flex!important;align-items:center!important;min-width:0!important;gap:11px!important}
body.aow-masters-theme :is(
  .bracket-team-picker .picker-current strong,
  .bracket-team-picker .picker-option-text strong,
  .results-team-select .results-team-select-current strong,
  .results-team-select .results-team-select-option-main strong,
  .aow-select-team-name,
  .correction-technical-picker .correction-picker-text strong
){font-family:var(--aow-heading,'Refrigerator Deluxe',sans-serif)!important;font-weight:800!important;font-size:22px!important;line-height:1.16!important;letter-spacing:.005em!important;color:#f2fff9!important;text-shadow:0 1px 2px #000c!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;min-width:0!important}
body.aow-masters-theme :is(
  .bracket-team-picker .picker-faction-icon,
  .results-team-select .results-team-select-current img,
  .results-team-select .results-team-select-option-main img,
  .aow-select-team img
){width:34px!important;height:34px!important;flex:0 0 34px!important;object-fit:contain!important;border-radius:0!important}
body.aow-masters-theme .aow-team-select,
body.aow-masters-theme .aow-team-select .aow-select-trigger{width:100%!important;min-width:0!important}
body.aow-masters-theme .aow-select-team{width:100%;max-width:100%}
body.aow-masters-theme .aow-team-select .aow-select-value{display:flex!important;align-items:center!important;min-width:0!important;overflow:hidden!important}
body.aow-masters-theme .aow-select-team-option{width:100%!important;justify-content:space-between!important;text-align:left!important}
body.aow-masters-theme .aow-select-team-option .aow-select-team{flex:1!important}
body.aow-masters-theme :is(
  .bracket-team-picker .picker-option.selected,
  .results-team-select .results-team-select-option.selected,
  .aow-select-team-option.selected
) strong{color:#fff!important}
@media(max-width:760px){
  body.aow-masters-theme :is(
    .bracket-team-picker .picker-current strong,
    .bracket-team-picker .picker-option-text strong,
    .results-team-select .results-team-select-current strong,
    .results-team-select .results-team-select-option-main strong,
    .aow-select-team-name
  ){font-size:19px!important}
  body.aow-masters-theme :is(
    .bracket-team-picker .picker-faction-icon,
    .results-team-select .results-team-select-current img,
    .results-team-select .results-team-select-option-main img,
    .aow-select-team img
  ){width:30px!important;height:30px!important;flex-basis:30px!important}
  body.aow-masters-theme .emergency-replacement-card #bulk-emergency-rows > div{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
